Skip to content

Commit

Permalink
feat(Enterprise Management): re-gen service after update trait object
Browse files Browse the repository at this point in the history
Signed-off-by: namratabhadauriya <[email protected]>
  • Loading branch information
namratabhadauriya committed Jul 5, 2023
1 parent 17e9ac5 commit 0a74cae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
18 changes: 14 additions & 4 deletions enterprisemanagementv1/enterprise_management_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down Expand Up @@ -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.
Expand All @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions enterprisemanagementv1/enterprise_management_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 0a74cae

Please sign in to comment.