From 0a74cae7d132827f1f574668f77b75aa3069a12b Mon Sep 17 00:00:00 2001 From: namratabhadauriya Date: Wed, 5 Jul 2023 21:09:27 +0530 Subject: [PATCH] feat(Enterprise Management): re-gen service after update trait object Signed-off-by: namratabhadauriya --- .../enterprise_management_v1.go | 18 ++++++++++++++---- .../enterprise_management_v1_test.go | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/enterprisemanagementv1/enterprise_management_v1.go b/enterprisemanagementv1/enterprise_management_v1.go index 7366b27e..abae10f2 100644 --- a/enterprisemanagementv1/enterprise_management_v1.go +++ b/enterprisemanagementv1/enterprise_management_v1.go @@ -1484,7 +1484,8 @@ type CreateAccountOptions struct { // The IAM ID of the account owner, such as `IBMid-0123ABC`. The IAM ID must already exist. OwnerIamID *string `json:"owner_iam_id" validate:"required"` - // The traits object can be used to opt-out of Multi-Factor Authentication setting when creating a child account in the + // The traits object can be used to set properties on child accounts of an enterprise. You can pass a field to opt-out + // of Multi-Factor Authentication setting or setup enterprise IAM settings when creating a child account in the // enterprise. This is an optional field. Traits *CreateAccountRequestTraits `json:"traits,omitempty"` @@ -1531,12 +1532,17 @@ func (options *CreateAccountOptions) SetHeaders(param map[string]string) *Create return options } -// CreateAccountRequestTraits : The traits object can be used to opt-out of Multi-Factor Authentication setting when creating a child account in the +// CreateAccountRequestTraits : The traits object can be used to set properties on child accounts of an enterprise. You can pass a field to opt-out +// of Multi-Factor Authentication setting or setup enterprise IAM settings when creating a child account in the // enterprise. This is an optional field. type CreateAccountRequestTraits struct { - // By default MFA will be set on the account. To opt out, pass the traits object with the mfa field set to empty - // string. + // By default MFA will be enabled on a child account. To opt out, pass the traits object with the mfa field set to + // empty string. This is an optional field. Mfa *string `json:"mfa,omitempty"` + + // The Enterprise IAM settings property will be turned off for a newly created child account by default. You can enable + // this property by passing 'true' in this boolean field. This is an optional field. + EnterpriseIamManaged *bool `json:"enterprise_iam_managed,omitempty"` } // UnmarshalCreateAccountRequestTraits unmarshals an instance of CreateAccountRequestTraits from the specified map of raw messages. @@ -1546,6 +1552,10 @@ func UnmarshalCreateAccountRequestTraits(m map[string]json.RawMessage, result in if err != nil { return } + err = core.UnmarshalPrimitive(m, "enterprise_iam_managed", &obj.EnterpriseIamManaged) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } diff --git a/enterprisemanagementv1/enterprise_management_v1_test.go b/enterprisemanagementv1/enterprise_management_v1_test.go index ac377f3c..4f4b5292 100644 --- a/enterprisemanagementv1/enterprise_management_v1_test.go +++ b/enterprisemanagementv1/enterprise_management_v1_test.go @@ -1181,6 +1181,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Construct an instance of the CreateAccountRequestTraits model createAccountRequestTraitsModel := new(enterprisemanagementv1.CreateAccountRequestTraits) createAccountRequestTraitsModel.Mfa = core.StringPtr("testString") + createAccountRequestTraitsModel.EnterpriseIamManaged = core.BoolPtr(true) // Construct an instance of the CreateAccountOptions model createAccountOptionsModel := new(enterprisemanagementv1.CreateAccountOptions) @@ -1255,6 +1256,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Construct an instance of the CreateAccountRequestTraits model createAccountRequestTraitsModel := new(enterprisemanagementv1.CreateAccountRequestTraits) createAccountRequestTraitsModel.Mfa = core.StringPtr("testString") + createAccountRequestTraitsModel.EnterpriseIamManaged = core.BoolPtr(true) // Construct an instance of the CreateAccountOptions model createAccountOptionsModel := new(enterprisemanagementv1.CreateAccountOptions) @@ -1337,6 +1339,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Construct an instance of the CreateAccountRequestTraits model createAccountRequestTraitsModel := new(enterprisemanagementv1.CreateAccountRequestTraits) createAccountRequestTraitsModel.Mfa = core.StringPtr("testString") + createAccountRequestTraitsModel.EnterpriseIamManaged = core.BoolPtr(true) // Construct an instance of the CreateAccountOptions model createAccountOptionsModel := new(enterprisemanagementv1.CreateAccountOptions) @@ -1364,6 +1367,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Construct an instance of the CreateAccountRequestTraits model createAccountRequestTraitsModel := new(enterprisemanagementv1.CreateAccountRequestTraits) createAccountRequestTraitsModel.Mfa = core.StringPtr("testString") + createAccountRequestTraitsModel.EnterpriseIamManaged = core.BoolPtr(true) // Construct an instance of the CreateAccountOptions model createAccountOptionsModel := new(enterprisemanagementv1.CreateAccountOptions) @@ -1412,6 +1416,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Construct an instance of the CreateAccountRequestTraits model createAccountRequestTraitsModel := new(enterprisemanagementv1.CreateAccountRequestTraits) createAccountRequestTraitsModel.Mfa = core.StringPtr("testString") + createAccountRequestTraitsModel.EnterpriseIamManaged = core.BoolPtr(true) // Construct an instance of the CreateAccountOptions model createAccountOptionsModel := new(enterprisemanagementv1.CreateAccountOptions) @@ -3151,7 +3156,9 @@ var _ = Describe(`EnterpriseManagementV1`, func() { createAccountRequestTraitsModel := new(enterprisemanagementv1.CreateAccountRequestTraits) Expect(createAccountRequestTraitsModel).ToNot(BeNil()) createAccountRequestTraitsModel.Mfa = core.StringPtr("testString") + createAccountRequestTraitsModel.EnterpriseIamManaged = core.BoolPtr(true) Expect(createAccountRequestTraitsModel.Mfa).To(Equal(core.StringPtr("testString"))) + Expect(createAccountRequestTraitsModel.EnterpriseIamManaged).To(Equal(core.BoolPtr(true))) // Construct an instance of the CreateAccountOptions model createAccountOptionsParent := "testString"