| 1 | package sarif |
| 2 | |
| 3 | // ArtifactLocation ... |
| 4 | type ArtifactLocation struct { // https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#_Toc10540865 |
| 5 | PropertyBag |
| 6 | URI *string `json:"uri,omitempty"` |
| 7 | URIBaseId *string `json:"uriBaseId,omitempty"` |
| 8 | Index *uint `json:"index,omitempty"` |
| 9 | Description *Message `json:"description,omitempty"` |
| 10 | } |
| 11 | |
| 12 | // NewArtifactLocation ... |
| 13 | func NewArtifactLocation() *ArtifactLocation { |
| 14 | return &ArtifactLocation{} |
| 15 | } |
| 16 | |
| 17 | // NewSimpleArtifactLocation ... |
| 18 | func NewSimpleArtifactLocation(uri string) *ArtifactLocation { |
| 19 | return NewArtifactLocation().WithUri(uri) |
| 20 | } |
| 21 | |
| 22 | // WithUri ... |
| 23 | func (a *ArtifactLocation) WithUri(uri string) *ArtifactLocation { |
| 24 | a.URI = &uri |
| 25 | return a |
| 26 | } |
| 27 | |
| 28 | // WithUriBaseId ... |
| 29 | func (a *ArtifactLocation) WithUriBaseId(uriBaseId string) *ArtifactLocation { |
| 30 | a.URIBaseId = &uriBaseId |
| 31 | return a |
| 32 | } |
| 33 | |
| 34 | // WithIndex ... |
| 35 | func (a *ArtifactLocation) WithIndex(index int) *ArtifactLocation { |
| 36 | i := uint(index) |
| 37 | a.Index = &i |
| 38 | return a |
| 39 | } |
| 40 | |
| 41 | // WithDescription ... |
| 42 | func (a *ArtifactLocation) WithDescription(message *Message) *ArtifactLocation { |
| 43 | a.Description = message |
| 44 | return a |
| 45 | } |