Skip to content

Commit 1a4cd4e

Browse files
add support for owner relationships on read (#598)
* add support for owner relationships on read * run task fix * update templates
1 parent a640bef commit 1a4cd4e

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

object.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,14 @@ type ComponentTypeId struct {
145145
// ComponentType Information about a particular component type
146146
type ComponentType struct {
147147
ComponentTypeId
148-
Description string // The description of the component type (Optional)
149-
Href string // The relative path to link to the component type (Required)
150-
Icon ComponentTypeIcon // The icon associated with the component type (Required)
151-
IsDefault bool // Whether or not the component type is the default (Required)
152-
Name string // The name of the component type (Required)
153-
Timestamps Timestamps // When the component type was created and updated (Required)
154-
Properties *PropertyDefinitionConnection `graphql:"-"`
148+
Description string // The description of the component type (Optional)
149+
Href string // The relative path to link to the component type (Required)
150+
Icon ComponentTypeIcon // The icon associated with the component type (Required)
151+
IsDefault bool // Whether or not the component type is the default (Required)
152+
Name string // The name of the component type (Required)
153+
OwnerRelationship OwnerRelationshipType // The owner relationship for this component type (Required)
154+
Timestamps Timestamps // When the component type was created and updated (Required)
155+
Properties *PropertyDefinitionConnection `graphql:"-"`
155156
}
156157

157158
// ComponentTypeIcon The icon for a component type
@@ -391,6 +392,11 @@ type ManualCheckFrequency struct {
391392
StartingDate iso8601.Time // The date that the check will start to evaluate (Required)
392393
}
393394

395+
// OwnerRelationshipType The owner relationship for a component type
396+
type OwnerRelationshipType struct {
397+
ManagementRules []RelationshipDefinitionManagementRule // The management rules for the owner relationship (Required)
398+
}
399+
394400
// Predicate A condition used to select services
395401
type Predicate struct {
396402
Type PredicateTypeEnum // Type of operation to be used in the condition (Required)

testdata/templates/component_type.tpl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- define "component_type_graphql" }}
2-
{id,aliases,description,href,icon{color,name},isDefault,name,timestamps{createdAt,updatedAt}}
2+
{id,aliases,description,href,icon{color,name},isDefault,name,ownerRelationship{managementRules{operator,sourceProperty,sourcePropertyBuiltin,targetCategory,targetProperty,targetPropertyBuiltin,targetType}},timestamps{createdAt,updatedAt}}
33
{{end}}
44
{{- define "component_type_1_response" }}
55
{
@@ -13,6 +13,19 @@
1313
"icon": {
1414
"color": "#FFFFFF",
1515
"name": "PhBird"
16+
},
17+
"ownerRelationship": {
18+
"managementRules": [
19+
{
20+
"operator": "EQUALS",
21+
"sourceProperty": "tag_key_eq:owner",
22+
"sourcePropertyBuiltin": true,
23+
"targetCategory": null,
24+
"targetProperty": "name",
25+
"targetPropertyBuiltin": true,
26+
"targetType": "team"
27+
}
28+
]
1629
}
1730
}
1831
{{end}}
@@ -45,4 +58,4 @@
4558
"name": "PhBird"
4659
}
4760
}
48-
{{end}}
61+
{{end}}

0 commit comments

Comments
 (0)