Skip to content

Commit a676c51

Browse files
regenerate projects provider with new go sdk level and API doc (IBM-Cloud#6557)
* support auto deploy mode * set the default for auto_deploy_mode * projects * projects * projects * projects * enrich test
1 parent b4bbd64 commit a676c51

19 files changed

+727
-97
lines changed

.secrets.baseline

Lines changed: 162 additions & 64 deletions
Large diffs are not rendered by default.

examples/ibm-project/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ resource "ibm_project_config" "project_config_instance" {
5454
| modified_at | A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ to match the date and time format as specified by RFC 3339. |
5555
| outputs | The outputs of a Schematics template property. |
5656
| references | The resolved references that are used by the configuration. |
57-
| state | The state of the configuration. |
5857
| state_code | Computed state code clarifying the prerequisites for validation for the configuration. |
5958
| config_error | The error from config actions. |
6059
| href | A Url. |
60+
| container_state | The aggregate state from all deployabe architectures that are included in this configuration. |
61+
| container_state_code | Computed state code clarifying the prerequisites for validation for the configuration. |
6162
| is_draft | The flag that indicates whether the version of the configuration is draft, or active. |
6263
| last_saved_at | A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ to match the date and time format as specified by RFC 3339. |
6364
| project | The project that is referenced by this resource. |
65+
| state | The state of the configuration. |
6466
| update_available | The flag that indicates whether a configuration update is available. |
6567
| template_id | The stack definition identifier. |
6668
| member_of | The stack config parent of which this configuration is a member of. |
@@ -159,14 +161,16 @@ data "ibm_project_config" "project_config_instance" {
159161
| modified_at | A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ to match the date and time format as specified by RFC 3339. |
160162
| outputs | The outputs of a Schematics template property. |
161163
| references | The resolved references that are used by the configuration. |
162-
| state | The state of the configuration. |
163164
| state_code | Computed state code clarifying the prerequisites for validation for the configuration. |
164165
| config_error | The error from config actions. |
165166
| href | A Url. |
167+
| container_state | The aggregate state from all deployabe architectures that are included in this configuration. |
168+
| container_state_code | Computed state code clarifying the prerequisites for validation for the configuration. |
166169
| is_draft | The flag that indicates whether the version of the configuration is draft, or active. |
167170
| last_saved_at | A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ to match the date and time format as specified by RFC 3339. |
168171
| project | The project that is referenced by this resource. |
169172
| schematics | A Schematics workspace that is associated to a project configuration, with scripts. |
173+
| state | The state of the configuration. |
170174
| update_available | The flag that indicates whether a configuration update is available. |
171175
| template_id | The stack definition identifier. |
172176
| member_of | The stack config parent of which this configuration is a member of. |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/IBM/mqcloud-go-sdk v0.4.0
3030
github.com/IBM/networking-go-sdk v0.51.12
3131
github.com/IBM/platform-services-go-sdk v0.90.0
32-
github.com/IBM/project-go-sdk v0.3.9
32+
github.com/IBM/project-go-sdk v0.4.0
3333
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
3434
github.com/IBM/sarama v1.45.0
3535
github.com/IBM/scc-go-sdk/v5 v5.5.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ github.com/IBM/networking-go-sdk v0.51.12 h1:2qv6neG8msFR1dtf9v+rbaC2gIkw9Hnzohv
150150
github.com/IBM/networking-go-sdk v0.51.12/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc=
151151
github.com/IBM/platform-services-go-sdk v0.90.0 h1:hsUkgZZBGYK+szFb0tF9Q7uy1VjMY+VlYAPgPwFPMrg=
152152
github.com/IBM/platform-services-go-sdk v0.90.0/go.mod h1:aGD045m6I8pfcB77wft8w2cHqWOJjcM3YSSV55BX0Js=
153-
github.com/IBM/project-go-sdk v0.3.9 h1:D/UfMMn+vMQyvYf9EfocV6HrD3HcVpeIVoUSjNKuROo=
154-
github.com/IBM/project-go-sdk v0.3.9/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
153+
github.com/IBM/project-go-sdk v0.4.0 h1:72pEtVHJn434+MYRawER7Hk/kblapdfotoLBBhjv/jo=
154+
github.com/IBM/project-go-sdk v0.4.0/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
155155
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
156156
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0=
157157
github.com/IBM/sarama v1.45.0 h1:IzeBevTn809IJ/dhNKhP5mpxEXTmELuezO2tgHD9G5E=

ibm/service/project/data_source_ibm_project.go

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Mozilla Public License v2.0
33

44
/*
5-
* IBM OpenAPI Terraform Generator Version: 3.107.1-41b0fbd0-20250825-080732
5+
* IBM OpenAPI Terraform Generator Version: 3.108.0-56772134-20251111-102802
66
*/
77

88
package project
@@ -136,6 +136,11 @@ func DataSourceIbmProject() *schema.Resource {
136136
},
137137
},
138138
},
139+
"container_state": &schema.Schema{
140+
Type: schema.TypeString,
141+
Computed: true,
142+
Description: "The aggregate state from all deployabe architectures that are included in this configuration.",
143+
},
139144
"state": &schema.Schema{
140145
Type: schema.TypeString,
141146
Computed: true,
@@ -179,6 +184,11 @@ func DataSourceIbmProject() *schema.Resource {
179184
},
180185
},
181186
},
187+
"container_state": &schema.Schema{
188+
Type: schema.TypeString,
189+
Computed: true,
190+
Description: "The aggregate state from all deployabe architectures that are included in this configuration.",
191+
},
182192
"state": &schema.Schema{
183193
Type: schema.TypeString,
184194
Computed: true,
@@ -207,11 +217,26 @@ func DataSourceIbmProject() *schema.Resource {
207217
Computed: true,
208218
Description: "The version of the configuration.",
209219
},
220+
"container_state": &schema.Schema{
221+
Type: schema.TypeString,
222+
Computed: true,
223+
Description: "The aggregate state from all deployabe architectures that are included in this configuration.",
224+
},
225+
"container_state_code": &schema.Schema{
226+
Type: schema.TypeString,
227+
Computed: true,
228+
Description: "Computed state code clarifying the prerequisites for validation for the configuration.",
229+
},
210230
"state": &schema.Schema{
211231
Type: schema.TypeString,
212232
Computed: true,
213233
Description: "The state of the configuration.",
214234
},
235+
"state_code": &schema.Schema{
236+
Type: schema.TypeString,
237+
Computed: true,
238+
Description: "Computed state code clarifying the prerequisites for validation for the configuration.",
239+
},
215240
"created_at": &schema.Schema{
216241
Type: schema.TypeString,
217242
Computed: true,
@@ -615,7 +640,16 @@ func DataSourceIbmProjectProjectConfigSummaryToMap(model *projectv1.ProjectConfi
615640
}
616641
modelMap["id"] = *model.ID
617642
modelMap["version"] = flex.IntValue(model.Version)
643+
if model.ContainerState != nil {
644+
modelMap["container_state"] = *model.ContainerState
645+
}
646+
if model.ContainerStateCode != nil {
647+
modelMap["container_state_code"] = *model.ContainerStateCode
648+
}
618649
modelMap["state"] = *model.State
650+
if model.StateCode != nil {
651+
modelMap["state_code"] = *model.StateCode
652+
}
619653
modelMap["created_at"] = model.CreatedAt.String()
620654
modelMap["modified_at"] = model.ModifiedAt.String()
621655
modelMap["href"] = *model.Href
@@ -640,6 +674,9 @@ func DataSourceIbmProjectProjectConfigVersionSummaryToMap(model *projectv1.Proje
640674
return modelMap, err
641675
}
642676
modelMap["definition"] = []map[string]interface{}{definitionMap}
677+
if model.ContainerState != nil {
678+
modelMap["container_state"] = *model.ContainerState
679+
}
643680
modelMap["state"] = *model.State
644681
modelMap["version"] = flex.IntValue(model.Version)
645682
modelMap["href"] = *model.Href

ibm/service/project/data_source_ibm_project_config.go

Lines changed: 101 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Mozilla Public License v2.0
33

44
/*
5-
* IBM OpenAPI Terraform Generator Version: 3.107.1-41b0fbd0-20250825-080732
5+
* IBM OpenAPI Terraform Generator Version: 3.108.0-56772134-20251111-102802
66
*/
77

88
package project
@@ -116,6 +116,11 @@ func DataSourceIbmProjectConfig() *schema.Resource {
116116
Computed: true,
117117
Description: "This property can be any value - a string, number, boolean, array, or object.",
118118
},
119+
"sensitive": &schema.Schema{
120+
Type: schema.TypeBool,
121+
Computed: true,
122+
Description: "Flag if the output value is sensitive. If not present, the output sensitivity is indeterminate.",
123+
},
119124
},
120125
},
121126
},
@@ -127,11 +132,6 @@ func DataSourceIbmProjectConfig() *schema.Resource {
127132
Schema: map[string]*schema.Schema{},
128133
},
129134
},
130-
"state": &schema.Schema{
131-
Type: schema.TypeString,
132-
Computed: true,
133-
Description: "The state of the configuration.",
134-
},
135135
"state_code": &schema.Schema{
136136
Type: schema.TypeString,
137137
Computed: true,
@@ -164,6 +164,16 @@ func DataSourceIbmProjectConfig() *schema.Resource {
164164
Computed: true,
165165
Description: "A Url.",
166166
},
167+
"container_state": &schema.Schema{
168+
Type: schema.TypeString,
169+
Computed: true,
170+
Description: "The aggregate state from all deployabe architectures that are included in this configuration.",
171+
},
172+
"container_state_code": &schema.Schema{
173+
Type: schema.TypeString,
174+
Computed: true,
175+
Description: "Computed state code clarifying the prerequisites for validation for the configuration.",
176+
},
167177
"is_draft": &schema.Schema{
168178
Type: schema.TypeBool,
169179
Computed: true,
@@ -370,6 +380,11 @@ func DataSourceIbmProjectConfig() *schema.Resource {
370380
},
371381
},
372382
},
383+
"state": &schema.Schema{
384+
Type: schema.TypeString,
385+
Computed: true,
386+
Description: "The state of the configuration.",
387+
},
373388
"update_available": &schema.Schema{
374389
Type: schema.TypeBool,
375390
Computed: true,
@@ -540,6 +555,25 @@ func DataSourceIbmProjectConfig() *schema.Resource {
540555
},
541556
},
542557
},
558+
"uses": &schema.Schema{
559+
Type: schema.TypeList,
560+
Computed: true,
561+
Description: "The depending deployabe architectures that are referenced by this configuration.",
562+
Elem: &schema.Resource{
563+
Schema: map[string]*schema.Schema{
564+
"config_id": &schema.Schema{
565+
Type: schema.TypeString,
566+
Computed: true,
567+
Description: "The unique ID.",
568+
},
569+
"project_id": &schema.Schema{
570+
Type: schema.TypeString,
571+
Computed: true,
572+
Description: "The unique ID.",
573+
},
574+
},
575+
},
576+
},
543577
"description": &schema.Schema{
544578
Type: schema.TypeString,
545579
Computed: true,
@@ -632,6 +666,11 @@ func DataSourceIbmProjectConfig() *schema.Resource {
632666
},
633667
},
634668
},
669+
"container_state": &schema.Schema{
670+
Type: schema.TypeString,
671+
Computed: true,
672+
Description: "The aggregate state from all deployabe architectures that are included in this configuration.",
673+
},
635674
"state": &schema.Schema{
636675
Type: schema.TypeString,
637676
Computed: true,
@@ -675,6 +714,11 @@ func DataSourceIbmProjectConfig() *schema.Resource {
675714
},
676715
},
677716
},
717+
"container_state": &schema.Schema{
718+
Type: schema.TypeString,
719+
Computed: true,
720+
Description: "The aggregate state from all deployabe architectures that are included in this configuration.",
721+
},
678722
"state": &schema.Schema{
679723
Type: schema.TypeString,
680724
Computed: true,
@@ -765,10 +809,6 @@ func dataSourceIbmProjectConfigRead(context context.Context, d *schema.ResourceD
765809
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting references: %s", err), "(Data) ibm_project_config", "read", "set-references").GetDiag()
766810
}
767811

768-
if err = d.Set("state", projectConfig.State); err != nil {
769-
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting state: %s", err), "(Data) ibm_project_config", "read", "set-state").GetDiag()
770-
}
771-
772812
if !core.IsNil(projectConfig.StateCode) {
773813
if err = d.Set("state_code", projectConfig.StateCode); err != nil {
774814
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting state_code: %s", err), "(Data) ibm_project_config", "read", "set-state_code").GetDiag()
@@ -791,6 +831,18 @@ func dataSourceIbmProjectConfigRead(context context.Context, d *schema.ResourceD
791831
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting href: %s", err), "(Data) ibm_project_config", "read", "set-href").GetDiag()
792832
}
793833

834+
if !core.IsNil(projectConfig.ContainerState) {
835+
if err = d.Set("container_state", projectConfig.ContainerState); err != nil {
836+
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting container_state: %s", err), "(Data) ibm_project_config", "read", "set-container_state").GetDiag()
837+
}
838+
}
839+
840+
if !core.IsNil(projectConfig.ContainerStateCode) {
841+
if err = d.Set("container_state_code", projectConfig.ContainerStateCode); err != nil {
842+
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting container_state_code: %s", err), "(Data) ibm_project_config", "read", "set-container_state_code").GetDiag()
843+
}
844+
}
845+
794846
if err = d.Set("is_draft", projectConfig.IsDraft); err != nil {
795847
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting is_draft: %s", err), "(Data) ibm_project_config", "read", "set-is_draft").GetDiag()
796848
}
@@ -823,6 +875,10 @@ func dataSourceIbmProjectConfigRead(context context.Context, d *schema.ResourceD
823875
}
824876
}
825877

878+
if err = d.Set("state", projectConfig.State); err != nil {
879+
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting state: %s", err), "(Data) ibm_project_config", "read", "set-state").GetDiag()
880+
}
881+
826882
if !core.IsNil(projectConfig.UpdateAvailable) {
827883
if err = d.Set("update_available", projectConfig.UpdateAvailable); err != nil {
828884
return flex.DiscriminatedTerraformErrorf(err, fmt.Sprintf("Error setting update_available: %s", err), "(Data) ibm_project_config", "read", "set-update_available").GetDiag()
@@ -915,6 +971,9 @@ func DataSourceIbmProjectConfigOutputValueToMap(model *projectv1.OutputValue) (m
915971
if model.Value != nil {
916972
modelMap["value"] = flex.Stringify(model.Value)
917973
}
974+
if model.Sensitive != nil {
975+
modelMap["sensitive"] = *model.Sensitive
976+
}
918977
return modelMap, nil
919978
}
920979

@@ -1090,6 +1149,17 @@ func DataSourceIbmProjectConfigProjectConfigDefinitionResponseToMap(model projec
10901149
}
10911150
modelMap["members"] = members
10921151
}
1152+
if model.Uses != nil {
1153+
uses := []map[string]interface{}{}
1154+
for _, usesItem := range model.Uses {
1155+
usesItemMap, err := DataSourceIbmProjectConfigProjectConfigUsesToMap(&usesItem) // #nosec G601
1156+
if err != nil {
1157+
return modelMap, err
1158+
}
1159+
uses = append(uses, usesItemMap)
1160+
}
1161+
modelMap["uses"] = uses
1162+
}
10931163
if model.Description != nil {
10941164
modelMap["description"] = *model.Description
10951165
}
@@ -1225,6 +1295,13 @@ func DataSourceIbmProjectConfigProjectComplianceProfileV1ToMap(model *projectv1.
12251295
return modelMap, nil
12261296
}
12271297

1298+
func DataSourceIbmProjectConfigProjectConfigUsesToMap(model *projectv1.ProjectConfigUses) (map[string]interface{}, error) {
1299+
modelMap := make(map[string]interface{})
1300+
modelMap["config_id"] = *model.ConfigID
1301+
modelMap["project_id"] = *model.ProjectID
1302+
return modelMap, nil
1303+
}
1304+
12281305
func DataSourceIbmProjectConfigProjectConfigAuthToMap(model *projectv1.ProjectConfigAuth) (map[string]interface{}, error) {
12291306
modelMap := make(map[string]interface{})
12301307
if model.TrustedProfileID != nil {
@@ -1262,6 +1339,17 @@ func DataSourceIbmProjectConfigProjectConfigDefinitionResponseDAConfigDefinition
12621339
}
12631340
modelMap["members"] = members
12641341
}
1342+
if model.Uses != nil {
1343+
uses := []map[string]interface{}{}
1344+
for _, usesItem := range model.Uses {
1345+
usesItemMap, err := DataSourceIbmProjectConfigProjectConfigUsesToMap(&usesItem) // #nosec G601
1346+
if err != nil {
1347+
return modelMap, err
1348+
}
1349+
uses = append(uses, usesItemMap)
1350+
}
1351+
modelMap["uses"] = uses
1352+
}
12651353
modelMap["description"] = *model.Description
12661354
modelMap["name"] = *model.Name
12671355
if model.Authorizations != nil {
@@ -1332,6 +1420,9 @@ func DataSourceIbmProjectConfigProjectConfigVersionSummaryToMap(model *projectv1
13321420
return modelMap, err
13331421
}
13341422
modelMap["definition"] = []map[string]interface{}{definitionMap}
1423+
if model.ContainerState != nil {
1424+
modelMap["container_state"] = *model.ContainerState
1425+
}
13351426
modelMap["state"] = *model.State
13361427
modelMap["version"] = flex.IntValue(model.Version)
13371428
modelMap["href"] = *model.Href

0 commit comments

Comments
 (0)