@@ -108,6 +108,12 @@ func GetIAMWorkforcePoolWorkforcePoolApiObject(d tpgresource.TerraformResourceDa
108
108
} else if v , ok := d .GetOkExists ("session_duration" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (sessionDurationProp )) && (ok || ! reflect .DeepEqual (v , sessionDurationProp )) {
109
109
obj ["sessionDuration" ] = sessionDurationProp
110
110
}
111
+ accessRestrictionsProp , err := expandIAMWorkforcePoolWorkforcePoolAccessRestrictions (d .Get ("access_restrictions" ), d , config )
112
+ if err != nil {
113
+ return nil , err
114
+ } else if v , ok := d .GetOkExists ("access_restrictions" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (accessRestrictionsProp )) && (ok || ! reflect .DeepEqual (v , accessRestrictionsProp )) {
115
+ obj ["accessRestrictions" ] = accessRestrictionsProp
116
+ }
111
117
112
118
return obj , nil
113
119
}
@@ -131,3 +137,59 @@ func expandIAMWorkforcePoolWorkforcePoolDisabled(v interface{}, d tpgresource.Te
131
137
func expandIAMWorkforcePoolWorkforcePoolSessionDuration (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
132
138
return v , nil
133
139
}
140
+
141
+ func expandIAMWorkforcePoolWorkforcePoolAccessRestrictions (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
142
+ l := v .([]interface {})
143
+ if len (l ) == 0 || l [0 ] == nil {
144
+ return nil , nil
145
+ }
146
+ raw := l [0 ]
147
+ original := raw .(map [string ]interface {})
148
+ transformed := make (map [string ]interface {})
149
+
150
+ transformedAllowedServices , err := expandIAMWorkforcePoolWorkforcePoolAccessRestrictionsAllowedServices (original ["allowed_services" ], d , config )
151
+ if err != nil {
152
+ return nil , err
153
+ } else if val := reflect .ValueOf (transformedAllowedServices ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
154
+ transformed ["allowedServices" ] = transformedAllowedServices
155
+ }
156
+
157
+ transformedDisableProgrammaticSignin , err := expandIAMWorkforcePoolWorkforcePoolAccessRestrictionsDisableProgrammaticSignin (original ["disable_programmatic_signin" ], d , config )
158
+ if err != nil {
159
+ return nil , err
160
+ } else if val := reflect .ValueOf (transformedDisableProgrammaticSignin ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
161
+ transformed ["disableProgrammaticSignin" ] = transformedDisableProgrammaticSignin
162
+ }
163
+
164
+ return transformed , nil
165
+ }
166
+
167
+ func expandIAMWorkforcePoolWorkforcePoolAccessRestrictionsAllowedServices (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
168
+ l := v .([]interface {})
169
+ req := make ([]interface {}, 0 , len (l ))
170
+ for _ , raw := range l {
171
+ if raw == nil {
172
+ continue
173
+ }
174
+ original := raw .(map [string ]interface {})
175
+ transformed := make (map [string ]interface {})
176
+
177
+ transformedDomain , err := expandIAMWorkforcePoolWorkforcePoolAccessRestrictionsAllowedServicesDomain (original ["domain" ], d , config )
178
+ if err != nil {
179
+ return nil , err
180
+ } else if val := reflect .ValueOf (transformedDomain ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
181
+ transformed ["domain" ] = transformedDomain
182
+ }
183
+
184
+ req = append (req , transformed )
185
+ }
186
+ return req , nil
187
+ }
188
+
189
+ func expandIAMWorkforcePoolWorkforcePoolAccessRestrictionsAllowedServicesDomain (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
190
+ return v , nil
191
+ }
192
+
193
+ func expandIAMWorkforcePoolWorkforcePoolAccessRestrictionsDisableProgrammaticSignin (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
194
+ return v , nil
195
+ }
0 commit comments