diff --git a/resources/environments/converter_gcp.go b/resources/environments/converter_gcp.go index 02b4fe6e..3b00fc5a 100644 --- a/resources/environments/converter_gcp.go +++ b/resources/environments/converter_gcp.go @@ -43,7 +43,7 @@ func toGcpEnvironmentRequest(ctx context.Context, model *gcpEnvironmentResourceM if model.FreeIpa != nil { res.FreeIpa = &environmentsmodels.GCPFreeIpaCreationRequest{ InstanceCountByGroup: int32(model.FreeIpa.InstanceCountByGroup.ValueInt64()), - InstanceType: model.FreeIpa.InstanceType.String(), + InstanceType: model.FreeIpa.InstanceType.ValueString(), Recipes: utils.FromSetValueToStringList(model.FreeIpa.Recipes), } } @@ -57,8 +57,8 @@ func toGcpEnvironmentRequest(ctx context.Context, model *gcpEnvironmentResourceM } if model.SecurityAccess != nil { res.SecurityAccess = &environmentsmodels.GcpSecurityAccessRequest{ - DefaultSecurityGroupID: model.SecurityAccess.DefaultSecurityGroupId.String(), - SecurityGroupIDForKnox: model.SecurityAccess.SecurityGroupIdForKnox.String(), + DefaultSecurityGroupID: model.SecurityAccess.DefaultSecurityGroupId.ValueString(), + SecurityGroupIDForKnox: model.SecurityAccess.SecurityGroupIdForKnox.ValueString(), } } res.Tags = ConvertGcpTags(ctx, model.Tags) diff --git a/resources/environments/converter_gcp_test.go b/resources/environments/converter_gcp_test.go index 3293cb35..93ce2f81 100644 --- a/resources/environments/converter_gcp_test.go +++ b/resources/environments/converter_gcp_test.go @@ -53,8 +53,8 @@ func TestToGcpEnvironmentRequestSecurityAccess(t *testing.T) { result := toGcpEnvironmentRequest(context.TODO(), testObject) assert.NotNilf(t, result.SecurityAccess, "SecurityAccess is expected to be not nil") - assert.Equal(t, testObject.SecurityAccess.DefaultSecurityGroupId.String(), result.SecurityAccess.DefaultSecurityGroupID) - assert.Equal(t, testObject.SecurityAccess.SecurityGroupIdForKnox.String(), result.SecurityAccess.SecurityGroupIDForKnox) + assert.Equal(t, testObject.SecurityAccess.DefaultSecurityGroupId.ValueString(), result.SecurityAccess.DefaultSecurityGroupID) + assert.Equal(t, testObject.SecurityAccess.SecurityGroupIdForKnox.ValueString(), result.SecurityAccess.SecurityGroupIDForKnox) } func TestToGcpEnvironmentRequestLogStorage(t *testing.T) { @@ -76,7 +76,7 @@ func TestToGcpEnvironmentRequestFreeIpa(t *testing.T) { assert.NotNilf(t, result.FreeIpa, "FreeIpa is expected to be not nil") assert.Equal(t, testObject.FreeIpa.InstanceCountByGroup.ValueInt64(), int64(result.FreeIpa.InstanceCountByGroup)) assert.Equal(t, len(testObject.FreeIpa.Recipes.Elements()), len(result.FreeIpa.Recipes)) - assert.Equal(t, testObject.FreeIpa.InstanceType.String(), result.FreeIpa.InstanceType) + assert.Equal(t, testObject.FreeIpa.InstanceType.ValueString(), result.FreeIpa.InstanceType) } func createFilledGcpEnvironmentResourceModel() *gcpEnvironmentResourceModel {