From 69040310cc8b2032198e35b5dd366e5a7a6bd49a Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Fri, 12 Dec 2025 15:13:29 -0500 Subject: [PATCH 1/3] add support for owner relationships on read --- object.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/object.go b/object.go index 8966b592..596f5f0c 100644 --- a/object.go +++ b/object.go @@ -150,6 +150,7 @@ type ComponentType struct { Icon ComponentTypeIcon // The icon associated with the component type (Required) IsDefault bool // Whether or not the component type is the default (Required) Name string // The name of the component type (Required) + OwnerRelationship OwnerRelationshipType // The owner relationship for this component type (Required) Timestamps Timestamps // When the component type was created and updated (Required) Properties *PropertyDefinitionConnection `graphql:"-"` } @@ -391,6 +392,11 @@ type ManualCheckFrequency struct { StartingDate iso8601.Time // The date that the check will start to evaluate (Required) } +// OwnerRelationshipType The owner relationship for a component type +type OwnerRelationshipType struct { + ManagementRules []RelationshipDefinitionManagementRule // The management rules for the owner relationship (Required) +} + // Predicate A condition used to select services type Predicate struct { Type PredicateTypeEnum // Type of operation to be used in the condition (Required) From 5f554fff73825b19af48fccc033b5c73c59d4d67 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Fri, 12 Dec 2025 15:15:05 -0500 Subject: [PATCH 2/3] run task fix --- object.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/object.go b/object.go index 596f5f0c..4ce3dcb3 100644 --- a/object.go +++ b/object.go @@ -145,14 +145,14 @@ type ComponentTypeId struct { // ComponentType Information about a particular component type type ComponentType struct { ComponentTypeId - Description string // The description of the component type (Optional) - Href string // The relative path to link to the component type (Required) - Icon ComponentTypeIcon // The icon associated with the component type (Required) - IsDefault bool // Whether or not the component type is the default (Required) - Name string // The name of the component type (Required) + Description string // The description of the component type (Optional) + Href string // The relative path to link to the component type (Required) + Icon ComponentTypeIcon // The icon associated with the component type (Required) + IsDefault bool // Whether or not the component type is the default (Required) + Name string // The name of the component type (Required) OwnerRelationship OwnerRelationshipType // The owner relationship for this component type (Required) - Timestamps Timestamps // When the component type was created and updated (Required) - Properties *PropertyDefinitionConnection `graphql:"-"` + Timestamps Timestamps // When the component type was created and updated (Required) + Properties *PropertyDefinitionConnection `graphql:"-"` } // ComponentTypeIcon The icon for a component type From 1b9a8acb610e90b229e4e2932589d8ceb621b4c6 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Fri, 12 Dec 2025 15:23:28 -0500 Subject: [PATCH 3/3] update templates --- testdata/templates/component_type.tpl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/testdata/templates/component_type.tpl b/testdata/templates/component_type.tpl index 4e0fef2c..f1634019 100644 --- a/testdata/templates/component_type.tpl +++ b/testdata/templates/component_type.tpl @@ -1,5 +1,5 @@ {{- define "component_type_graphql" }} -{id,aliases,description,href,icon{color,name},isDefault,name,timestamps{createdAt,updatedAt}} +{id,aliases,description,href,icon{color,name},isDefault,name,ownerRelationship{managementRules{operator,sourceProperty,sourcePropertyBuiltin,targetCategory,targetProperty,targetPropertyBuiltin,targetType}},timestamps{createdAt,updatedAt}} {{end}} {{- define "component_type_1_response" }} { @@ -13,6 +13,19 @@ "icon": { "color": "#FFFFFF", "name": "PhBird" + }, + "ownerRelationship": { + "managementRules": [ + { + "operator": "EQUALS", + "sourceProperty": "tag_key_eq:owner", + "sourcePropertyBuiltin": true, + "targetCategory": null, + "targetProperty": "name", + "targetPropertyBuiltin": true, + "targetType": "team" + } + ] } } {{end}} @@ -45,4 +58,4 @@ "name": "PhBird" } } -{{end}} \ No newline at end of file +{{end}}