@@ -72,33 +72,21 @@ func createRelationshipRequestBody(workspaceId string, relationship ResourceRela
7272 WorkspaceId : workspaceId ,
7373 Reference : relationship .Reference ,
7474 DependencyType : api .ResourceRelationshipRuleDependencyType (relationship .DependencyType ),
75- MetadataKeysMatches : & []struct {
76- SourceKey string `json:"sourceKey"`
77- TargetKey string `json:"targetKey"`
78- }{},
79- TargetMetadataEquals : & []struct {
80- Key string `json:"key"`
81- Value string `json:"value"`
82- }{},
75+ MetadataKeysMatches : & []api.MetadataKeyMatchConstraint {},
76+ TargetMetadataEquals : & []api.MetadataEqualsConstraint {},
8377 }
8478
8579 if relationship .Target != nil {
8680 config .TargetKind = relationship .Target .Kind
8781 config .TargetVersion = relationship .Target .Version
8882
8983 if relationship .Target .MetadataEquals != nil {
90- targetMetadataEquals := []struct {
91- Key string `json:"key"`
92- Value string `json:"value"`
93- }{}
84+ targetMetadataEquals := []api.MetadataEqualsConstraint {}
9485
9586 for key , value := range relationship .Target .MetadataEquals {
96- targetMetadataEquals = append (targetMetadataEquals , struct {
97- Key string `json:"key"`
98- Value string `json:"value"`
99- }{
100- Key : key ,
101- Value : value ,
87+ targetMetadataEquals = append (targetMetadataEquals , api.MetadataEqualsConstraint {
88+ Key : & key ,
89+ Value : & value ,
10290 })
10391 }
10492
@@ -112,10 +100,7 @@ func createRelationshipRequestBody(workspaceId string, relationship ResourceRela
112100 }
113101
114102 if relationship .MetadataKeysMatch != nil {
115- metadataKeysMatches := []struct {
116- SourceKey string `json:"sourceKey"`
117- TargetKey string `json:"targetKey"`
118- }{}
103+ metadataKeysMatches := []api.MetadataKeyMatchConstraint {}
119104
120105 for _ , match := range relationship .MetadataKeysMatch {
121106 metadataKeysMatch , err := createMetadataKeysMatch (match )
@@ -134,7 +119,7 @@ func createRelationshipRequestBody(workspaceId string, relationship ResourceRela
134119 if config .TargetMetadataEquals != nil && len (* config .TargetMetadataEquals ) > 0 {
135120 fmt .Println ("MetadataTargetEquals:" )
136121 for _ , kv := range * config .TargetMetadataEquals {
137- fmt .Printf (" Key: %s, Value: %s\n " , kv .Key , kv .Value )
122+ fmt .Printf (" Key: %s, Value: %s\n " , * kv .Key , * kv .Value )
138123 }
139124 }
140125
0 commit comments