Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

constructors.go 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. package garif
  2. // NewAddress creates a valid Address
  3. func NewAddress() *Address {
  4. return &Address{}
  5. }
  6. // NewArtifact creates a valid Artifact
  7. func NewArtifact() *Artifact {
  8. return &Artifact{}
  9. }
  10. // NewArtifactChange creates a valid ArtifactChange
  11. func NewArtifactChange(location *ArtifactLocation, replacements ...*Replacement) *ArtifactChange {
  12. return &ArtifactChange{
  13. ArtifactLocation: location,
  14. Replacements: replacements,
  15. }
  16. }
  17. // NewArtifactContent creates a valid ArtifactContent
  18. func NewArtifactContent() *ArtifactContent {
  19. return &ArtifactContent{}
  20. }
  21. // NewArtifactLocation creates a valid ArtifactLocation
  22. func NewArtifactLocation() *ArtifactLocation {
  23. return &ArtifactLocation{}
  24. }
  25. // NewAttachment creates a valid Attachment
  26. func NewAttachment(location *ArtifactLocation) *Attachment {
  27. return &Attachment{ArtifactLocation: location}
  28. }
  29. // NewCodeFlow creates a valid CodeFlow
  30. func NewCodeFlow(threadFlows ...*ThreadFlow) *CodeFlow {
  31. return &CodeFlow{ThreadFlows: threadFlows}
  32. }
  33. // NewConfigurationOverride creates a valid ConfigurationOverride
  34. func NewConfigurationOverride(configuration *ReportingConfiguration, descriptor *ReportingDescriptorReference) *ConfigurationOverride {
  35. return &ConfigurationOverride{
  36. Configuration: configuration,
  37. Descriptor: descriptor,
  38. }
  39. }
  40. // NewConversion creates a valid Conversion
  41. func NewConversion(tool *Tool) *Conversion {
  42. return &Conversion{Tool: tool}
  43. }
  44. // NewEdge creates a valid Edge
  45. func NewEdge(id, sourceNodeId, targetNodeId string) *Edge {
  46. return &Edge{
  47. Id: id,
  48. SourceNodeId: sourceNodeId,
  49. TargetNodeId: targetNodeId,
  50. }
  51. }
  52. // NewEdgeTraversal creates a valid EdgeTraversal
  53. func NewEdgeTraversal(edgeId string) *EdgeTraversal {
  54. return &EdgeTraversal{
  55. EdgeId: edgeId,
  56. }
  57. }
  58. // NewException creates a valid Exception
  59. func NewException() *Exception {
  60. return &Exception{}
  61. }
  62. // NewExternalProperties creates a valid ExternalProperties
  63. func NewExternalProperties() *ExternalProperties {
  64. return &ExternalProperties{}
  65. }
  66. // NewExternalPropertyFileReference creates a valid ExternalPropertyFileReference
  67. func NewExternalPropertyFileReference() *ExternalPropertyFileReference {
  68. return &ExternalPropertyFileReference{}
  69. }
  70. // NewExternalPropertyFileReferences creates a valid ExternalPropertyFileReferences
  71. func NewExternalPropertyFileReferences() *ExternalPropertyFileReferences {
  72. return &ExternalPropertyFileReferences{}
  73. }
  74. // NewFix creates a valid Fix
  75. func NewFix(artifactChanges ...*ArtifactChange) *Fix {
  76. return &Fix{
  77. ArtifactChanges: artifactChanges,
  78. }
  79. }
  80. // NewGraph creates a valid Graph
  81. func NewGraph() *Graph {
  82. return &Graph{}
  83. }
  84. // NewGraphTraversal creates a valid GraphTraversal
  85. func NewGraphTraversal() *GraphTraversal {
  86. return &GraphTraversal{}
  87. }
  88. // NewInvocation creates a valid Invocation
  89. func NewInvocation(executionSuccessful bool) *Invocation {
  90. return &Invocation{
  91. ExecutionSuccessful: executionSuccessful,
  92. }
  93. }
  94. // NewLocation creates a valid Location
  95. func NewLocation() *Location {
  96. return &Location{}
  97. }
  98. // NewLocationRelationship creates a valid LocationRelationship
  99. func NewLocationRelationship(target int) *LocationRelationship {
  100. return &LocationRelationship{
  101. Target: target,
  102. }
  103. }
  104. type LogFileVersion string
  105. const Version210 LogFileVersion = "2.1.0"
  106. // NewLogFile creates a valid LogFile
  107. func NewLogFile(runs []*Run, version LogFileVersion) *LogFile {
  108. return &LogFile{
  109. Runs: runs,
  110. Version: version,
  111. }
  112. }
  113. // NewLogicalLocation creates a valid LogicalLocation
  114. func NewLogicalLocation() *LogicalLocation {
  115. return &LogicalLocation{}
  116. }
  117. // NewMessage creates a valid Message
  118. func NewMessage() *Message {
  119. return &Message{}
  120. }
  121. // NewMessageFromText creates a valid Message with the given text
  122. func NewMessageFromText(text string) *Message {
  123. return &Message{
  124. Text: text,
  125. }
  126. }
  127. // NewMultiformatMessageString creates a valid MultiformatMessageString
  128. func NewMultiformatMessageString(text string) *MultiformatMessageString {
  129. return &MultiformatMessageString{
  130. Text: text,
  131. }
  132. }
  133. // NewNode creates a valid Node
  134. func NewNode(id string) *Node {
  135. return &Node{
  136. Id: id,
  137. }
  138. }
  139. // NewNotification creates a valid Notification
  140. func NewNotification(message *Message) *Notification {
  141. return &Notification{
  142. Message: message,
  143. }
  144. }
  145. // NewPhysicalLocation creates a valid PhysicalLocation
  146. func NewPhysicalLocation() *PhysicalLocation {
  147. return &PhysicalLocation{}
  148. }
  149. // NewPropertyBag creates a valid PropertyBag
  150. func NewPropertyBag() *PropertyBag {
  151. return &PropertyBag{}
  152. }
  153. // NewRectangle creates a valid Rectangle
  154. func NewRectangle() *Rectangle {
  155. return &Rectangle{}
  156. }
  157. // NewRegion creates a valid Region
  158. func NewRegion() *Region {
  159. return &Region{}
  160. }
  161. // NewReplacement creates a valid Replacement
  162. func NewReplacement(deletedRegion *Region) *Replacement {
  163. return &Replacement{
  164. DeletedRegion: deletedRegion,
  165. }
  166. }
  167. // NewReportingConfiguration creates a valid ReportingConfiguration
  168. func NewReportingConfiguration() *ReportingConfiguration {
  169. return &ReportingConfiguration{}
  170. }
  171. // NewReportingDescriptor creates a valid ReportingDescriptor
  172. func NewReportingDescriptor(id string) *ReportingDescriptor {
  173. return &ReportingDescriptor{
  174. Id: id,
  175. }
  176. }
  177. // NewRule is an alias for NewReportingDescriptor
  178. func NewRule(id string) *ReportingDescriptor {
  179. return NewReportingDescriptor(id)
  180. }
  181. // NewReportingDescriptorReference creates a valid ReportingDescriptorReference
  182. func NewReportingDescriptorReference() *ReportingDescriptorReference {
  183. return &ReportingDescriptorReference{}
  184. }
  185. // NewReportingDescriptorRelationship creates a valid ReportingDescriptorRelationship
  186. func NewReportingDescriptorRelationship(target *ReportingDescriptorReference) *ReportingDescriptorRelationship {
  187. return &ReportingDescriptorRelationship{
  188. Target: target,
  189. }
  190. }
  191. // NewResult creates a valid Result
  192. func NewResult(message *Message) *Result {
  193. return &Result{
  194. Message: message,
  195. }
  196. }
  197. // NewResultProvenance creates a valid ResultProvenance
  198. func NewResultProvenance() *ResultProvenance {
  199. return &ResultProvenance{}
  200. }
  201. // NewRun creates a valid Run
  202. func NewRun(tool *Tool) *Run {
  203. return &Run{
  204. Tool: tool,
  205. }
  206. }
  207. // NewRunAutomationDetails creates a valid RunAutomationDetails
  208. func NewRunAutomationDetails() *RunAutomationDetails {
  209. return &RunAutomationDetails{}
  210. }
  211. // New creates a valid
  212. func NewSpecialLocations() *SpecialLocations {
  213. return &SpecialLocations{}
  214. }
  215. // NewStack creates a valid Stack
  216. func NewStack(frames ...*StackFrame) *Stack {
  217. return &Stack{
  218. Frames: frames,
  219. }
  220. }
  221. // NewStackFrame creates a valid StackFrame
  222. func NewStackFrame() *StackFrame {
  223. return &StackFrame{}
  224. }
  225. // NewSuppression creates a valid Suppression
  226. func NewSuppression(kind string) *Suppression {
  227. return &Suppression{
  228. Kind: kind,
  229. }
  230. }
  231. // NewThreadFlow creates a valid ThreadFlow
  232. func NewThreadFlow(locations []*ThreadFlowLocation) *ThreadFlow {
  233. return &ThreadFlow{
  234. Locations: locations,
  235. }
  236. }
  237. // NewThreadFlowLocation creates a valid ThreadFlowLocation
  238. func NewThreadFlowLocation() *ThreadFlowLocation {
  239. return &ThreadFlowLocation{}
  240. }
  241. // NewTool creates a valid Tool
  242. func NewTool(driver *ToolComponent) *Tool {
  243. return &Tool{
  244. Driver: driver,
  245. }
  246. }
  247. // NewToolComponent creates a valid ToolComponent
  248. func NewToolComponent(name string) *ToolComponent {
  249. return &ToolComponent{
  250. Name: name,
  251. }
  252. }
  253. // NewDriver is an alias for NewToolComponent
  254. func NewDriver(name string) *ToolComponent {
  255. return NewToolComponent(name)
  256. }
  257. // NewToolComponentReference creates a valid ToolComponentReference
  258. func NewToolComponentReference() *ToolComponentReference {
  259. return &ToolComponentReference{}
  260. }
  261. // NewTranslationMetadata creates a valid TranslationMetadata
  262. func NewTranslationMetadata(name string) *TranslationMetadata {
  263. return &TranslationMetadata{
  264. Name: name,
  265. }
  266. }
  267. // NewVersionControlDetails creates a valid VersionControlDetails
  268. func NewVersionControlDetails(repositoryUri string) *VersionControlDetails {
  269. return &VersionControlDetails{
  270. RepositoryUri: repositoryUri,
  271. }
  272. }
  273. // NewWebRequest creates a valid WebRequest
  274. func NewWebRequest() *WebRequest {
  275. return &WebRequest{}
  276. }
  277. // NewWebResponse creates a valid WebResponse
  278. func NewWebResponse() *WebResponse {
  279. return &WebResponse{}
  280. }