| 1 |
package sarif |
| 2 |
|
| 3 |
// Fix ... |
| 4 |
type Fix struct { |
| 5 |
Description *Message `json:"description,omitempty"` |
| 6 |
ArtifactChanges []*ArtifactChange `json:"artifactChanges"` |
| 7 |
PropertyBag |
| 8 |
} |
| 9 |
|
| 10 |
// NewFix creates a new Fix and returns a pointer to it |
| 11 |
func NewFix() *Fix { |
| 12 |
return &Fix{} |
| 13 |
} |
| 14 |
|
| 15 |
// WithDescription sets the Description |
| 16 |
func (fix *Fix) WithDescription(message *Message) *Fix { |
| 17 |
fix.Description = message |
| 18 |
return fix |
| 19 |
} |
| 20 |
|
| 21 |
// WithDescriptionText sets the DescriptionText |
| 22 |
func (fix *Fix) WithDescriptionText(text string) *Fix { |
| 23 |
if fix.Description == nil { |
| 24 |
fix.Description = &Message{} |
| 25 |
} |
| 26 |
fix.Description.Text = &text |
| 27 |
return fix |
| 28 |
} |
| 29 |
|
| 30 |
// WithDescriptionMarkdown sets the DescriptionMarkdown |
| 31 |
func (fix *Fix) WithDescriptionMarkdown(markdown string) *Fix { |
| 32 |
if fix.Description == nil { |
| 33 |
fix.Description = &Message{} |
| 34 |
} |
| 35 |
fix.Description.Markdown = &markdown |
| 36 |
return fix |
| 37 |
} |
| 38 |
|
| 39 |
// WithArtifactChanges sets the ArtifactChanges |
| 40 |
func (fix *Fix) WithArtifactChanges(artifactChanges []*ArtifactChange) *Fix { |
| 41 |
fix.ArtifactChanges = artifactChanges |
| 42 |
return fix |
| 43 |
} |
| 44 |
|
| 45 |
// AddArtifactChanges ... |
| 46 |
func (fix *Fix) AddArtifactChanges(artifactChange *ArtifactChange) { |
| 47 |
fix.ArtifactChanges = append(fix.ArtifactChanges, artifactChange) |
| 48 |
} |