Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20260409-144550.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: Add SystemRelationship support on ComponentType and ComponentTypeInput
time: 2026-04-09T14:45:50.438117+05:30
18 changes: 12 additions & 6 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,13 @@ type ComponentTypeIconInput struct {

// ComponentTypeInput Specifies the input fields used to create a component type
type ComponentTypeInput struct {
Alias *Nullable[string] `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique alias of the component type (Optional)
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the component type (Optional)
Icon *ComponentTypeIconInput `json:"icon,omitempty" yaml:"icon,omitempty"` // The icon associated with the component type (Optional)
Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The unique name of the component type (Optional)
OwnerRelationship *OwnerRelationshipInput `json:"ownerRelationship,omitempty" yaml:"ownerRelationship,omitempty"` // The owner relationship for the component type (Optional)
Properties *[]ComponentTypePropertyDefinitionInput `json:"properties,omitempty" yaml:"properties,omitempty" example:"[]"` // A list of property definitions for the component type (Optional)
Alias *Nullable[string] `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique alias of the component type (Optional)
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the component type (Optional)
Icon *ComponentTypeIconInput `json:"icon,omitempty" yaml:"icon,omitempty"` // The icon associated with the component type (Optional)
Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The unique name of the component type (Optional)
OwnerRelationship *OwnerRelationshipInput `json:"ownerRelationship,omitempty" yaml:"ownerRelationship,omitempty"` // The owner relationship for the component type (Optional)
SystemRelationship *SystemRelationshipInput `json:"systemRelationship,omitempty" yaml:"systemRelationship,omitempty"` // The system relationship for the component type (Optional)
Properties *[]ComponentTypePropertyDefinitionInput `json:"properties,omitempty" yaml:"properties,omitempty" example:"[]"` // A list of property definitions for the component type (Optional)
}

// ComponentTypePropertyDefinitionInput The input for defining a property
Expand Down Expand Up @@ -998,6 +999,11 @@ type OwnerRelationshipInput struct {
ManagementRules *[]ManagementRuleInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional)
}

// SystemRelationshipInput The input for defining the system relationship for a component type
type SystemRelationshipInput struct {
ManagementRules *[]ManagementRuleInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional)
}

// PayloadFilterInput Input to be used to filter types
type PayloadFilterInput struct {
Arg *Nullable[string] `json:"arg,omitempty" yaml:"arg,omitempty" example:"example_value"` // Value to be filtered (Optional)
Expand Down
22 changes: 14 additions & 8 deletions object.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ 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)
OwnerRelationship OwnerRelationshipType // The owner relationship for this component type (Required)
Timestamps Timestamps // When the component type was created and updated (Required)
Properties *PropertyDefinitionConnection `graphql:"-"`
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)
SystemRelationship SystemRelationshipType // The system relationship for this component type (Required)
Timestamps Timestamps // When the component type was created and updated (Required)
Properties *PropertyDefinitionConnection `graphql:"-"`
}

// ComponentTypeIcon The icon for a component type
Expand Down Expand Up @@ -397,6 +398,11 @@ type OwnerRelationshipType struct {
ManagementRules []RelationshipDefinitionManagementRule // The management rules for the owner relationship (Required)
}

// SystemRelationshipType The system relationship for a component type
type SystemRelationshipType struct {
ManagementRules []RelationshipDefinitionManagementRule // The management rules for the system relationship (Required)
}

// Predicate A condition used to select services
type Predicate struct {
Type PredicateTypeEnum // Type of operation to be used in the condition (Required)
Expand Down
15 changes: 14 additions & 1 deletion testdata/templates/component_type.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- define "component_type_graphql" }}
{id,aliases,description,href,icon{color,name},isDefault,name,ownerRelationship{managementRules{operator,sourceProperty,sourcePropertyBuiltin,targetCategory,targetProperty,targetPropertyBuiltin,targetType}},timestamps{createdAt,updatedAt}}
{id,aliases,description,href,icon{color,name},isDefault,name,ownerRelationship{managementRules{operator,sourceProperty,sourcePropertyBuiltin,targetCategory,targetProperty,targetPropertyBuiltin,targetType}},systemRelationship{managementRules{operator,sourceProperty,sourcePropertyBuiltin,targetCategory,targetProperty,targetPropertyBuiltin,targetType}},timestamps{createdAt,updatedAt}}
{{end}}
{{- define "component_type_1_response" }}
{
Expand All @@ -26,6 +26,19 @@
"targetType": "team"
}
]
},
"systemRelationship": {
"managementRules": [
{
"operator": "EQUALS",
"sourceProperty": "tag_key_eq:system",
"sourcePropertyBuiltin": true,
"targetCategory": null,
"targetProperty": "name",
"targetPropertyBuiltin": true,
"targetType": "system"
}
]
}
}
{{end}}
Expand Down
Loading