| 1 |
package sarif |
| 2 |
|
| 3 |
// ArtifactLocation ... |
| 4 |
type ArtifactLocation struct { |
| 5 |
URI *string `json:"uri,omitempty"` |
| 6 |
URIBaseId *string `json:"uriBaseId,omitempty"` |
| 7 |
Index *uint `json:"index,omitempty"` |
| 8 |
Description *Message `json:"description,omitempty"` |
| 9 |
PropertyBag |
| 10 |
} |
| 11 |
|
| 12 |
// NewArtifactLocation creates a new ArtifactLocation and returns a pointer to it |
| 13 |
func NewArtifactLocation() *ArtifactLocation { |
| 14 |
return &ArtifactLocation{} |
| 15 |
} |
| 16 |
|
| 17 |
// NewSimpleArtifactLocation creates a new SimpleArtifactLocation and returns a pointer to it |
| 18 |
func NewSimpleArtifactLocation(uri string) *ArtifactLocation { |
| 19 |
return NewArtifactLocation().WithUri(uri) |
| 20 |
} |
| 21 |
|
| 22 |
// WithUri sets the Uri |
| 23 |
func (artifactLocation *ArtifactLocation) WithUri(uri string) *ArtifactLocation { |
| 24 |
artifactLocation.URI = &uri |
| 25 |
return artifactLocation |
| 26 |
} |
| 27 |
|
| 28 |
// WithUriBaseId sets the UriBaseId |
| 29 |
func (artifactLocation *ArtifactLocation) WithUriBaseId(uriBaseId string) *ArtifactLocation { |
| 30 |
artifactLocation.URIBaseId = &uriBaseId |
| 31 |
return artifactLocation |
| 32 |
} |
| 33 |
|
| 34 |
// WithIndex sets the Index |
| 35 |
func (artifactLocation *ArtifactLocation) WithIndex(index int) *ArtifactLocation { |
| 36 |
i := uint(index) |
| 37 |
artifactLocation.Index = &i |
| 38 |
return artifactLocation |
| 39 |
} |
| 40 |
|
| 41 |
// WithDescription sets the Description |
| 42 |
func (artifactLocation *ArtifactLocation) WithDescription(message *Message) *ArtifactLocation { |
| 43 |
artifactLocation.Description = message |
| 44 |
return artifactLocation |
| 45 |
} |
| 46 |
|
| 47 |
// WithDescriptionText sets the DescriptionText |
| 48 |
func (artifactLocation *ArtifactLocation) WithDescriptionText(text string) *ArtifactLocation { |
| 49 |
if artifactLocation.Description == nil { |
| 50 |
artifactLocation.Description = &Message{} |
| 51 |
} |
| 52 |
artifactLocation.Description.Text = &text |
| 53 |
return artifactLocation |
| 54 |
} |
| 55 |
|
| 56 |
// WithDescriptionMarkdown sets the DescriptionMarkdown |
| 57 |
func (artifactLocation *ArtifactLocation) WithDescriptionMarkdown(markdown string) *ArtifactLocation { |
| 58 |
if artifactLocation.Description == nil { |
| 59 |
artifactLocation.Description = &Message{} |
| 60 |
} |
| 61 |
artifactLocation.Description.Markdown = &markdown |
| 62 |
return artifactLocation |
| 63 |
} |