Skip to content

Commit 0ff7960

Browse files
WiP labels on Integration struct
1 parent 1e17613 commit 0ff7960

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

integration.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type Integration struct {
3535
Type string `json:"type"`
3636
DefaultRoute *DefaultRoute `json:"default_route"`
3737
Templates *Templates `json:"templates"`
38+
Labels []*Label `json:"labels"`
3839
}
3940

4041
type DefaultRoute struct {
@@ -83,6 +84,11 @@ type ImageURLTemplate struct {
8384
ImageURL *string `json:"image_url"`
8485
}
8586

87+
type Label struct {
88+
Key string `json:"key"`
89+
Value string `json:"value"`
90+
}
91+
8692
type ListIntegrationOptions struct {
8793
ListOptions
8894
}
@@ -136,6 +142,7 @@ type CreateIntegrationOptions struct {
136142
Type string `json:"type,omitempty"`
137143
Templates *Templates `json:"templates,omitempty"`
138144
DefaultRoute *DefaultRoute `json:"default_route,omitempty"`
145+
Labels []*Label `json:"labels,omitempty"`
139146
}
140147

141148
// CreateIntegration creates integration with type, team_id and optional given name.
@@ -163,6 +170,7 @@ type UpdateIntegrationOptions struct {
163170
TeamId string `json:"team_id"`
164171
Templates *Templates `json:"templates,omitempty"`
165172
DefaultRoute *DefaultRoute `json:"default_route,omitempty"`
173+
Labels []*Label `json:"labels,omitempty"`
166174
}
167175

168176
// UpdateIntegration updates integration with new templates, name and default route.

integration_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ var testIntegration = &Integration{
6060
nil,
6161
},
6262
},
63+
Labels: []*Label{
64+
&Label{
65+
Key: "Flip",
66+
Value: "Flop",
67+
},
68+
},
6369
}
6470

6571
var testIntegrationBody = `{
@@ -111,7 +117,13 @@ var testIntegrationBody = `{
111117
"title":null,
112118
"message":null
113119
}
114-
}
120+
},
121+
"labels":[
122+
{
123+
"key": "Flip",
124+
"value": "Flop"
125+
}
126+
]
115127
}`
116128

117129
func TestCreateIntegration(t *testing.T) {

0 commit comments

Comments
 (0)