| 1 | package sarif |
| 2 | |
| 3 | // Replacement ... |
| 4 | type Replacement struct { |
| 5 | DeletedRegion Region `json:"deletedRegion"` |
| 6 | InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` |
| 7 | PropertyBag |
| 8 | |
| 9 | } |
| 10 | |
| 11 | // NewReplacement creates a new Replacement and returns a pointer to it |
| 12 | func NewReplacement(region *Region) *Replacement { |
| 13 | return &Replacement{ |
| 14 | DeletedRegion: *region, |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | // WithInsertedContent sets the InsertedContent |
| 19 | func (r *Replacement) WithInsertedContent(artifactContent *ArtifactContent) *Replacement { |
| 20 | r.InsertedContent = artifactContent |
| 21 | return r |
| 22 | } |