-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
location_relationship.go
52 lines (45 loc) · 1.68 KB
/
location_relationship.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package sarif
// LocationRelationship ...
type LocationRelationship struct {
Target uint `json:"target"`
Kinds []string `json:"kinds,omitempty"`
Description *Message `json:"description,omitempty"`
PropertyBag
}
// NewLocationRelationship creates a new LocationRelationship and returns a pointer to it
func NewLocationRelationship(target int) *LocationRelationship {
t := uint(target)
return &LocationRelationship{
Target: t,
}
}
// WithKinds sets the Kinds
func (locationRelationship *LocationRelationship) WithKinds(kinds []string) *LocationRelationship {
locationRelationship.Kinds = kinds
return locationRelationship
}
// AddKind ...
func (locationRelationship *LocationRelationship) AddKind(kind string) {
locationRelationship.Kinds = append(locationRelationship.Kinds, kind)
}
// WithDescription sets the Description
func (locationRelationship *LocationRelationship) WithDescription(message *Message) *LocationRelationship {
locationRelationship.Description = message
return locationRelationship
}
// WithDescriptionText sets the DescriptionText
func (locationRelationship *LocationRelationship) WithDescriptionText(text string) *LocationRelationship {
if locationRelationship.Description == nil {
locationRelationship.Description = &Message{}
}
locationRelationship.Description.Text = &text
return locationRelationship
}
// WithDescriptionMarkdown sets the DescriptionMarkdown
func (locationRelationship *LocationRelationship) WithDescriptionMarkdown(markdown string) *LocationRelationship {
if locationRelationship.Description == nil {
locationRelationship.Description = &Message{}
}
locationRelationship.Description.Markdown = &markdown
return locationRelationship
}