diff --git a/iamidentityv1/iam_identity_v1.go b/iamidentityv1/iam_identity_v1.go index a9b7394a..34624e3f 100644 --- a/iamidentityv1/iam_identity_v1.go +++ b/iamidentityv1/iam_identity_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027 + * IBM OpenAPI SDK Code Generator Version: 3.93.0-c40121e6-20240729-182103 */ // Package iamidentityv1 : Operations and models for the IamIdentityV1 service @@ -173,9 +173,7 @@ func (iamIdentity *IamIdentityV1) DisableRetries() { // ListAPIKeys : Get API keys for a given service or user IAM ID and account ID // Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API keys -// for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of -// service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space -// developer in order to manage service IDs of the entity. +// for themself, or service ID API keys for service IDs they have access to. func (iamIdentity *IamIdentityV1) ListAPIKeys(listAPIKeysOptions *ListAPIKeysOptions) (result *APIKeyList, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.ListAPIKeysWithContext(context.Background(), listAPIKeysOptions) err = core.RepurposeSDKProblem(err, "") @@ -264,7 +262,7 @@ func (iamIdentity *IamIdentityV1) ListAPIKeysWithContext(ctx context.Context, li // CreateAPIKey : Create an API key // Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys -// for service IDs that are bound to an entity they have access to. +// for service IDs they have access to. func (iamIdentity *IamIdentityV1) CreateAPIKey(createAPIKeyOptions *CreateAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.CreateAPIKeyWithContext(context.Background(), createAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -368,7 +366,7 @@ func (iamIdentity *IamIdentityV1) CreateAPIKeyWithContext(ctx context.Context, c // GetAPIKeysDetails : Get details of an API key by its value // Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys -// for service IDs that are bound to an entity they have access to. +// for service IDs they have access to. func (iamIdentity *IamIdentityV1) GetAPIKeysDetails(getAPIKeysDetailsOptions *GetAPIKeysDetailsOptions) (result *APIKey, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.GetAPIKeysDetailsWithContext(context.Background(), getAPIKeysDetailsOptions) err = core.RepurposeSDKProblem(err, "") @@ -436,8 +434,7 @@ func (iamIdentity *IamIdentityV1) GetAPIKeysDetailsWithContext(ctx context.Conte // GetAPIKey : Get details of an API key // Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service -// IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either -// an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. +// IDs they have access to. func (iamIdentity *IamIdentityV1) GetAPIKey(getAPIKeyOptions *GetAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.GetAPIKeyWithContext(context.Background(), getAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -515,8 +512,8 @@ func (iamIdentity *IamIdentityV1) GetAPIKeyWithContext(ctx context.Context, getA // UpdateAPIKey : Updates an API key // Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay // unchanged until the access token is refreshed. To update an API key, pass the property to be modified. To delete one -// property's value, pass the property with an empty value "".Users can manage user API keys for themself, or service ID -// API keys for service IDs that are bound to an entity they have access to. +// property's value, pass the property with an empty value "". Users can manage user API keys for themself, or service +// ID API keys for service IDs they have access to. func (iamIdentity *IamIdentityV1) UpdateAPIKey(updateAPIKeyOptions *UpdateAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.UpdateAPIKeyWithContext(context.Background(), updateAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -609,7 +606,7 @@ func (iamIdentity *IamIdentityV1) UpdateAPIKeyWithContext(ctx context.Context, u // DeleteAPIKey : Deletes an API key // Deletes an API key. Existing tokens will remain valid until expired. Users can manage user API keys for themself, or -// service ID API keys for service IDs that are bound to an entity they have access to. +// service ID API keys for service IDs they have access to. func (iamIdentity *IamIdentityV1) DeleteAPIKey(deleteAPIKeyOptions *DeleteAPIKeyOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.DeleteAPIKeyWithContext(context.Background(), deleteAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -668,9 +665,8 @@ func (iamIdentity *IamIdentityV1) DeleteAPIKeyWithContext(ctx context.Context, d } // LockAPIKey : Lock the API key -// Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are -// bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account -// owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. +// Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have +// access to. func (iamIdentity *IamIdentityV1) LockAPIKey(lockAPIKeyOptions *LockAPIKeyOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.LockAPIKeyWithContext(context.Background(), lockAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -729,9 +725,8 @@ func (iamIdentity *IamIdentityV1) LockAPIKeyWithContext(ctx context.Context, loc } // UnlockAPIKey : Unlock the API key -// Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that -// are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an -// account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. +// Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they +// have access to. func (iamIdentity *IamIdentityV1) UnlockAPIKey(unlockAPIKeyOptions *UnlockAPIKeyOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.UnlockAPIKeyWithContext(context.Background(), unlockAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -789,9 +784,9 @@ func (iamIdentity *IamIdentityV1) UnlockAPIKeyWithContext(ctx context.Context, u return } -// DisableAPIKey : disable the API key -// Disable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are -// bound to an entity they have access to. +// DisableAPIKey : Disable the API key +// Disable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have +// access to. func (iamIdentity *IamIdentityV1) DisableAPIKey(disableAPIKeyOptions *DisableAPIKeyOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.DisableAPIKeyWithContext(context.Background(), disableAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -850,8 +845,8 @@ func (iamIdentity *IamIdentityV1) DisableAPIKeyWithContext(ctx context.Context, } // EnableAPIKey : Enable the API key -// Enable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound -// to an entity they have access to. +// Enable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have +// access to. func (iamIdentity *IamIdentityV1) EnableAPIKey(enableAPIKeyOptions *EnableAPIKeyOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.EnableAPIKeyWithContext(context.Background(), enableAPIKeyOptions) err = core.RepurposeSDKProblem(err, "") @@ -911,8 +906,8 @@ func (iamIdentity *IamIdentityV1) EnableAPIKeyWithContext(ctx context.Context, e // ListServiceIds : List service IDs // Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs -// that are bound to an entity they have access to. Note: apikey details are only included in the response when creating -// a Service ID with an api key. +// they have access to. Note: apikey details are only included in the response when creating a Service ID with an api +// key. func (iamIdentity *IamIdentityV1) ListServiceIds(listServiceIdsOptions *ListServiceIdsOptions) (result *ServiceIDList, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.ListServiceIdsWithContext(context.Background(), listServiceIdsOptions) err = core.RepurposeSDKProblem(err, "") @@ -995,7 +990,7 @@ func (iamIdentity *IamIdentityV1) ListServiceIdsWithContext(ctx context.Context, // CreateServiceID : Create a service ID // Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys -// for service IDs that are bound to an entity they have access to. +// for service IDs they have access to. func (iamIdentity *IamIdentityV1) CreateServiceID(createServiceIDOptions *CreateServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.CreateServiceIDWithContext(context.Background(), createServiceIDOptions) err = core.RepurposeSDKProblem(err, "") @@ -1087,8 +1082,8 @@ func (iamIdentity *IamIdentityV1) CreateServiceIDWithContext(ctx context.Context // GetServiceID : Get details of a service ID // Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service -// IDs that are bound to an entity they have access to. Note: apikey details are only included in the response when -// creating a Service ID with an api key. +// IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an +// api key. func (iamIdentity *IamIdentityV1) GetServiceID(getServiceIDOptions *GetServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.GetServiceIDWithContext(context.Background(), getServiceIDOptions) err = core.RepurposeSDKProblem(err, "") @@ -1167,8 +1162,8 @@ func (iamIdentity *IamIdentityV1) GetServiceIDWithContext(ctx context.Context, g // Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay // unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete // one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or -// service ID API keys for service IDs that are bound to an entity they have access to. Note: apikey details are only -// included in the response when creating a Service ID with an apikey. +// service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when +// creating a Service ID with an apikey. func (iamIdentity *IamIdentityV1) UpdateServiceID(updateServiceIDOptions *UpdateServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { result, response, err = iamIdentity.UpdateServiceIDWithContext(context.Background(), updateServiceIDOptions) err = core.RepurposeSDKProblem(err, "") @@ -1260,7 +1255,7 @@ func (iamIdentity *IamIdentityV1) UpdateServiceIDWithContext(ctx context.Context // Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are // deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only // deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself, or -// service ID API keys for service IDs that are bound to an entity they have access to. +// service ID API keys for service IDs they have access to. func (iamIdentity *IamIdentityV1) DeleteServiceID(deleteServiceIDOptions *DeleteServiceIDOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.DeleteServiceIDWithContext(context.Background(), deleteServiceIDOptions) err = core.RepurposeSDKProblem(err, "") @@ -1319,9 +1314,8 @@ func (iamIdentity *IamIdentityV1) DeleteServiceIDWithContext(ctx context.Context } // LockServiceID : Lock the service ID -// Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that -// are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an -// account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. +// Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they +// have access to. func (iamIdentity *IamIdentityV1) LockServiceID(lockServiceIDOptions *LockServiceIDOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.LockServiceIDWithContext(context.Background(), lockServiceIDOptions) err = core.RepurposeSDKProblem(err, "") @@ -1380,9 +1374,8 @@ func (iamIdentity *IamIdentityV1) LockServiceIDWithContext(ctx context.Context, } // UnlockServiceID : Unlock the service ID -// Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that -// are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an -// account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. +// Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they +// have access to. func (iamIdentity *IamIdentityV1) UnlockServiceID(unlockServiceIDOptions *UnlockServiceIDOptions) (response *core.DetailedResponse, err error) { response, err = iamIdentity.UnlockServiceIDWithContext(context.Background(), unlockServiceIDOptions) err = core.RepurposeSDKProblem(err, "") @@ -4599,6 +4592,82 @@ func (iamIdentity *IamIdentityV1) GetReportWithContext(ctx context.Context, getR return } +// GetEffectiveAccountSettings : Get effective account settings configuration +// Returns effective account settings for given account ID. +func (iamIdentity *IamIdentityV1) GetEffectiveAccountSettings(getEffectiveAccountSettingsOptions *GetEffectiveAccountSettingsOptions) (result *EffectiveAccountSettingsResponse, response *core.DetailedResponse, err error) { + result, response, err = iamIdentity.GetEffectiveAccountSettingsWithContext(context.Background(), getEffectiveAccountSettingsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetEffectiveAccountSettingsWithContext is an alternate form of the GetEffectiveAccountSettings method which supports a Context parameter +func (iamIdentity *IamIdentityV1) GetEffectiveAccountSettingsWithContext(ctx context.Context, getEffectiveAccountSettingsOptions *GetEffectiveAccountSettingsOptions) (result *EffectiveAccountSettingsResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEffectiveAccountSettingsOptions, "getEffectiveAccountSettingsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getEffectiveAccountSettingsOptions, "getEffectiveAccountSettingsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "account_id": *getEffectiveAccountSettingsOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamIdentity.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamIdentity.Service.Options.URL, `/v1/accounts/{account_id}/effective_settings/identity`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range getEffectiveAccountSettingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "GetEffectiveAccountSettings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if getEffectiveAccountSettingsOptions.IncludeHistory != nil { + builder.AddQuery("include_history", fmt.Sprint(*getEffectiveAccountSettingsOptions.IncludeHistory)) + } + if getEffectiveAccountSettingsOptions.ResolveUserMfa != nil { + builder.AddQuery("resolve_user_mfa", fmt.Sprint(*getEffectiveAccountSettingsOptions.ResolveUserMfa)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = iamIdentity.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_effective_account_settings", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEffectiveAccountSettingsResponse) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + // ListTrustedProfileAssignments : List assignments // List trusted profile template assignments. func (iamIdentity *IamIdentityV1) ListTrustedProfileAssignments(listTrustedProfileAssignmentsOptions *ListTrustedProfileAssignmentsOptions) (result *TemplateAssignmentListResponse, response *core.DetailedResponse, err error) { @@ -5137,6 +5206,9 @@ func (iamIdentity *IamIdentityV1) CreateProfileTemplateWithContext(ctx context.C if createProfileTemplateOptions.PolicyTemplateReferences != nil { body["policy_template_references"] = createProfileTemplateOptions.PolicyTemplateReferences } + if createProfileTemplateOptions.ActionControls != nil { + body["action_controls"] = createProfileTemplateOptions.ActionControls + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -5447,6 +5519,9 @@ func (iamIdentity *IamIdentityV1) CreateProfileTemplateVersionWithContext(ctx co if createProfileTemplateVersionOptions.PolicyTemplateReferences != nil { body["policy_template_references"] = createProfileTemplateVersionOptions.PolicyTemplateReferences } + if createProfileTemplateVersionOptions.ActionControls != nil { + body["action_controls"] = createProfileTemplateVersionOptions.ActionControls + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -5617,6 +5692,9 @@ func (iamIdentity *IamIdentityV1) UpdateProfileTemplateVersionWithContext(ctx co if updateProfileTemplateVersionOptions.PolicyTemplateReferences != nil { body["policy_template_references"] = updateProfileTemplateVersionOptions.PolicyTemplateReferences } + if updateProfileTemplateVersionOptions.ActionControls != nil { + body["action_controls"] = updateProfileTemplateVersionOptions.ActionControls + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -5812,8 +5890,11 @@ func UnmarshalAccountBasedMfaEnrollment(m map[string]json.RawMessage, result int return } -// AccountSettingsComponent : AccountSettingsComponent struct -type AccountSettingsComponent struct { +// AccountSettingsAccountSection : AccountSettingsAccountSection struct +type AccountSettingsAccountSection struct { + // Unique ID of the account. + AccountID *string `json:"account_id,omitempty"` + // Defines whether or not creating a service ID is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner @@ -5830,7 +5911,7 @@ type AccountSettingsComponent struct { // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA trait for the account. Valid values: + // Defines the MFA requirement for the user. Valid values: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -5841,7 +5922,10 @@ type AccountSettingsComponent struct { Mfa *string `json:"mfa,omitempty"` // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa,omitempty"` + UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` + + // History of the Account Settings. + History []EnityHistoryRecord `json:"history,omitempty"` // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' @@ -5869,7 +5953,512 @@ type AccountSettingsComponent struct { SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` } -// Constants associated with the AccountSettingsComponent.RestrictCreateServiceID property. +// Constants associated with the AccountSettingsAccountSection.RestrictCreateServiceID property. +// Defines whether or not creating a service ID is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsAccountSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAccountSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsAccountSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsAccountSection.RestrictCreatePlatformApikey property. +// Defines whether or not creating platform API keys is access controlled. Valid values: +// - RESTRICTED - to apply access control +// - NOT_RESTRICTED - to remove access control +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsAccountSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAccountSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsAccountSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsAccountSection.Mfa property. +// Defines the MFA requirement for the user. Valid values: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - TOTP - For all non-federated IBMId users +// - TOTP4ALL - For all users +// - LEVEL1 - Email-based MFA for all users +// - LEVEL2 - TOTP-based MFA for all users +// - LEVEL3 - U2F MFA for all users. +const ( + AccountSettingsAccountSectionMfaLevel1Const = "LEVEL1" + AccountSettingsAccountSectionMfaLevel2Const = "LEVEL2" + AccountSettingsAccountSectionMfaLevel3Const = "LEVEL3" + AccountSettingsAccountSectionMfaNoneConst = "NONE" + AccountSettingsAccountSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsAccountSectionMfaTotpConst = "TOTP" + AccountSettingsAccountSectionMfaTotp4allConst = "TOTP4ALL" +) + +// UnmarshalAccountSettingsAccountSection unmarshals an instance of AccountSettingsAccountSection from the specified map of raw messages. +func UnmarshalAccountSettingsAccountSection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsAccountSection) + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) + if err != nil { + err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AccountSettingsAssignedTemplatesSection : AccountSettingsAssignedTemplatesSection struct +type AccountSettingsAssignedTemplatesSection struct { + // Template Id. + TemplateID *string `json:"template_id,omitempty"` + + // Template version. + TemplateVersion *int64 `json:"template_version,omitempty"` + + // Template name. + TemplateName *string `json:"template_name,omitempty"` + + // Defines whether or not creating a service ID is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` + + // Defines whether or not creating platform API keys is access controlled. Valid values: + // * RESTRICTED - to apply access control + // * NOT_RESTRICTED - to remove access control + // * NOT_SET - to 'unset' a previous set value. + RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. + AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` + + // Defines the MFA requirement for the user. Valid values: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * TOTP - For all non-federated IBMId users + // * TOTP4ALL - For all users + // * LEVEL1 - Email-based MFA for all users + // * LEVEL2 - TOTP-based MFA for all users + // * LEVEL3 - U2F MFA for all users. + Mfa *string `json:"mfa,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` + + // Defines the session expiration in seconds for the account. Valid values: + // * Any whole number between between '900' and '86400' + // * NOT_SET - To unset account setting and use service default. + SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` + + // Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: + // * Any whole number between '900' and '7200' + // * NOT_SET - To unset account setting and use service default. + SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` + + // Defines the max allowed sessions per identity required by the account. Valid values: + // * Any whole number greater than 0 + // * NOT_SET - To unset account setting and use service default. + MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` + + // Defines the access token expiration in seconds. Valid values: + // * Any whole number between '900' and '3600' + // * NOT_SET - To unset account setting and use service default. + SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` + + // Defines the refresh token expiration in seconds. Valid values: + // * Any whole number between '900' and '259200' + // * NOT_SET - To unset account setting and use service default. + SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` +} + +// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreateServiceID property. +// Defines whether or not creating a service ID is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsAssignedTemplatesSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreatePlatformApikey property. +// Defines whether or not creating platform API keys is access controlled. Valid values: +// - RESTRICTED - to apply access control +// - NOT_RESTRICTED - to remove access control +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsAssignedTemplatesSection.Mfa property. +// Defines the MFA requirement for the user. Valid values: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - TOTP - For all non-federated IBMId users +// - TOTP4ALL - For all users +// - LEVEL1 - Email-based MFA for all users +// - LEVEL2 - TOTP-based MFA for all users +// - LEVEL3 - U2F MFA for all users. +const ( + AccountSettingsAssignedTemplatesSectionMfaLevel1Const = "LEVEL1" + AccountSettingsAssignedTemplatesSectionMfaLevel2Const = "LEVEL2" + AccountSettingsAssignedTemplatesSectionMfaLevel3Const = "LEVEL3" + AccountSettingsAssignedTemplatesSectionMfaNoneConst = "NONE" + AccountSettingsAssignedTemplatesSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsAssignedTemplatesSectionMfaTotpConst = "TOTP" + AccountSettingsAssignedTemplatesSectionMfaTotp4allConst = "TOTP4ALL" +) + +// UnmarshalAccountSettingsAssignedTemplatesSection unmarshals an instance of AccountSettingsAssignedTemplatesSection from the specified map of raw messages. +func UnmarshalAccountSettingsAssignedTemplatesSection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsAssignedTemplatesSection) + err = core.UnmarshalPrimitive(m, "template_id", &obj.TemplateID) + if err != nil { + err = core.SDKErrorf(err, "", "template_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "template_version", &obj.TemplateVersion) + if err != nil { + err = core.SDKErrorf(err, "", "template_version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "template_name", &obj.TemplateName) + if err != nil { + err = core.SDKErrorf(err, "", "template_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AccountSettingsComponent : AccountSettingsComponent struct +type AccountSettingsComponent struct { + // Defines whether or not creating a service ID is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` + + // Defines whether or not creating platform API keys is access controlled. Valid values: + // * RESTRICTED - to apply access control + // * NOT_RESTRICTED - to remove access control + // * NOT_SET - to 'unset' a previous set value. + RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. + AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` + + // Defines the MFA trait for the account. Valid values: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * TOTP - For all non-federated IBMId users + // * TOTP4ALL - For all users + // * LEVEL1 - Email-based MFA for all users + // * LEVEL2 - TOTP-based MFA for all users + // * LEVEL3 - U2F MFA for all users. + Mfa *string `json:"mfa,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []AccountSettingsUserMfa `json:"user_mfa,omitempty"` + + // Defines the session expiration in seconds for the account. Valid values: + // * Any whole number between between '900' and '86400' + // * NOT_SET - To unset account setting and use service default. + SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` + + // Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: + // * Any whole number between '900' and '7200' + // * NOT_SET - To unset account setting and use service default. + SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` + + // Defines the max allowed sessions per identity required by the account. Valid values: + // * Any whole number greater than 0 + // * NOT_SET - To unset account setting and use service default. + MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` + + // Defines the access token expiration in seconds. Valid values: + // * Any whole number between '900' and '3600' + // * NOT_SET - To unset account setting and use service default. + SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` + + // Defines the refresh token expiration in seconds. Valid values: + // * Any whole number between '900' and '259200' + // * NOT_SET - To unset account setting and use service default. + SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` +} + +// Constants associated with the AccountSettingsComponent.RestrictCreateServiceID property. +// Defines whether or not creating a service ID is access controlled. Valid values: +// - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// +// IDs, including the account owner +// - NOT_RESTRICTED - all members of an account can create service IDs +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsComponentRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsComponentRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsComponentRestrictCreateServiceIDRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsComponent.RestrictCreatePlatformApikey property. +// Defines whether or not creating platform API keys is access controlled. Valid values: +// - RESTRICTED - to apply access control +// - NOT_RESTRICTED - to remove access control +// - NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsComponentRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsComponentRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsComponentRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" +) + +// Constants associated with the AccountSettingsComponent.Mfa property. +// Defines the MFA trait for the account. Valid values: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - TOTP - For all non-federated IBMId users +// - TOTP4ALL - For all users +// - LEVEL1 - Email-based MFA for all users +// - LEVEL2 - TOTP-based MFA for all users +// - LEVEL3 - U2F MFA for all users. +const ( + AccountSettingsComponentMfaLevel1Const = "LEVEL1" + AccountSettingsComponentMfaLevel2Const = "LEVEL2" + AccountSettingsComponentMfaLevel3Const = "LEVEL3" + AccountSettingsComponentMfaNoneConst = "NONE" + AccountSettingsComponentMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsComponentMfaTotpConst = "TOTP" + AccountSettingsComponentMfaTotp4allConst = "TOTP4ALL" +) + +// UnmarshalAccountSettingsComponent unmarshals an instance of AccountSettingsComponent from the specified map of raw messages. +func UnmarshalAccountSettingsComponent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsComponent) + err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfa) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AccountSettingsEffectiveSection : AccountSettingsEffectiveSection struct +type AccountSettingsEffectiveSection struct { + // Defines whether or not creating a service ID is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` + + // Defines whether or not creating platform API keys is access controlled. Valid values: + // * RESTRICTED - to apply access control + // * NOT_RESTRICTED - to remove access control + // * NOT_SET - to 'unset' a previous set value. + RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. + AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` + + // Defines the MFA requirement for the user. Valid values: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * TOTP - For all non-federated IBMId users + // * TOTP4ALL - For all users + // * LEVEL1 - Email-based MFA for all users + // * LEVEL2 - TOTP-based MFA for all users + // * LEVEL3 - U2F MFA for all users. + Mfa *string `json:"mfa,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` + + // Defines the session expiration in seconds for the account. Valid values: + // * Any whole number between between '900' and '86400' + // * NOT_SET - To unset account setting and use service default. + SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` + + // Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: + // * Any whole number between '900' and '7200' + // * NOT_SET - To unset account setting and use service default. + SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` + + // Defines the max allowed sessions per identity required by the account. Valid values: + // * Any whole number greater than 0 + // * NOT_SET - To unset account setting and use service default. + MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` + + // Defines the access token expiration in seconds. Valid values: + // * Any whole number between '900' and '3600' + // * NOT_SET - To unset account setting and use service default. + SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` + + // Defines the refresh token expiration in seconds. Valid values: + // * Any whole number between '900' and '259200' + // * NOT_SET - To unset account setting and use service default. + SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` +} + +// Constants associated with the AccountSettingsEffectiveSection.RestrictCreateServiceID property. // Defines whether or not creating a service ID is access controlled. Valid values: // - RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // @@ -5877,24 +6466,24 @@ type AccountSettingsComponent struct { // - NOT_RESTRICTED - all members of an account can create service IDs // - NOT_SET - to 'unset' a previous set value. const ( - AccountSettingsComponentRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsComponentRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsComponentRestrictCreateServiceIDRestrictedConst = "RESTRICTED" + AccountSettingsEffectiveSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsEffectiveSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" + AccountSettingsEffectiveSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" ) -// Constants associated with the AccountSettingsComponent.RestrictCreatePlatformApikey property. +// Constants associated with the AccountSettingsEffectiveSection.RestrictCreatePlatformApikey property. // Defines whether or not creating platform API keys is access controlled. Valid values: // - RESTRICTED - to apply access control // - NOT_RESTRICTED - to remove access control // - NOT_SET - to 'unset' a previous set value. const ( - AccountSettingsComponentRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsComponentRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsComponentRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" + AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" ) -// Constants associated with the AccountSettingsComponent.Mfa property. -// Defines the MFA trait for the account. Valid values: +// Constants associated with the AccountSettingsEffectiveSection.Mfa property. +// Defines the MFA requirement for the user. Valid values: // - NONE - No MFA trait set // - NONE_NO_ROPC- No MFA, disable CLI logins with only a password // - TOTP - For all non-federated IBMId users @@ -5903,18 +6492,18 @@ const ( // - LEVEL2 - TOTP-based MFA for all users // - LEVEL3 - U2F MFA for all users. const ( - AccountSettingsComponentMfaLevel1Const = "LEVEL1" - AccountSettingsComponentMfaLevel2Const = "LEVEL2" - AccountSettingsComponentMfaLevel3Const = "LEVEL3" - AccountSettingsComponentMfaNoneConst = "NONE" - AccountSettingsComponentMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsComponentMfaTotpConst = "TOTP" - AccountSettingsComponentMfaTotp4allConst = "TOTP4ALL" + AccountSettingsEffectiveSectionMfaLevel1Const = "LEVEL1" + AccountSettingsEffectiveSectionMfaLevel2Const = "LEVEL2" + AccountSettingsEffectiveSectionMfaLevel3Const = "LEVEL3" + AccountSettingsEffectiveSectionMfaNoneConst = "NONE" + AccountSettingsEffectiveSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsEffectiveSectionMfaTotpConst = "TOTP" + AccountSettingsEffectiveSectionMfaTotp4allConst = "TOTP4ALL" ) -// UnmarshalAccountSettingsComponent unmarshals an instance of AccountSettingsComponent from the specified map of raw messages. -func UnmarshalAccountSettingsComponent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsComponent) +// UnmarshalAccountSettingsEffectiveSection unmarshals an instance of AccountSettingsEffectiveSection from the specified map of raw messages. +func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsEffectiveSection) err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) if err != nil { err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) @@ -5935,7 +6524,7 @@ func UnmarshalAccountSettingsComponent(m map[string]json.RawMessage, result inte err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfa) + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) if err != nil { err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) return @@ -6412,6 +7001,161 @@ func UnmarshalAccountSettingsUserMfa(m map[string]json.RawMessage, result interf return } +// ActionControls : ActionControls struct +type ActionControls struct { + Identities *ActionControlsIdentities `json:"identities,omitempty"` + + Rules *ActionControlsRules `json:"rules" validate:"required"` + + Policies *ActionControlsPolicies `json:"policies" validate:"required"` +} + +// NewActionControls : Instantiate ActionControls (Generic Model Constructor) +func (*IamIdentityV1) NewActionControls(rules *ActionControlsRules, policies *ActionControlsPolicies) (_model *ActionControls, err error) { + _model = &ActionControls{ + Rules: rules, + Policies: policies, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalActionControls unmarshals an instance of ActionControls from the specified map of raw messages. +func UnmarshalActionControls(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControls) + err = core.UnmarshalModel(m, "identities", &obj.Identities, UnmarshalActionControlsIdentities) + if err != nil { + err = core.SDKErrorf(err, "", "identities-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "rules", &obj.Rules, UnmarshalActionControlsRules) + if err != nil { + err = core.SDKErrorf(err, "", "rules-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalActionControlsPolicies) + if err != nil { + err = core.SDKErrorf(err, "", "policies-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlsIdentities : ActionControlsIdentities struct +type ActionControlsIdentities struct { + Add *bool `json:"add" validate:"required"` + + Remove *bool `json:"remove" validate:"required"` +} + +// NewActionControlsIdentities : Instantiate ActionControlsIdentities (Generic Model Constructor) +func (*IamIdentityV1) NewActionControlsIdentities(add bool, remove bool) (_model *ActionControlsIdentities, err error) { + _model = &ActionControlsIdentities{ + Add: core.BoolPtr(add), + Remove: core.BoolPtr(remove), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalActionControlsIdentities unmarshals an instance of ActionControlsIdentities from the specified map of raw messages. +func UnmarshalActionControlsIdentities(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlsIdentities) + err = core.UnmarshalPrimitive(m, "add", &obj.Add) + if err != nil { + err = core.SDKErrorf(err, "", "add-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "remove", &obj.Remove) + if err != nil { + err = core.SDKErrorf(err, "", "remove-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlsPolicies : ActionControlsPolicies struct +type ActionControlsPolicies struct { + Add *bool `json:"add" validate:"required"` + + Remove *bool `json:"remove" validate:"required"` +} + +// NewActionControlsPolicies : Instantiate ActionControlsPolicies (Generic Model Constructor) +func (*IamIdentityV1) NewActionControlsPolicies(add bool, remove bool) (_model *ActionControlsPolicies, err error) { + _model = &ActionControlsPolicies{ + Add: core.BoolPtr(add), + Remove: core.BoolPtr(remove), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalActionControlsPolicies unmarshals an instance of ActionControlsPolicies from the specified map of raw messages. +func UnmarshalActionControlsPolicies(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlsPolicies) + err = core.UnmarshalPrimitive(m, "add", &obj.Add) + if err != nil { + err = core.SDKErrorf(err, "", "add-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "remove", &obj.Remove) + if err != nil { + err = core.SDKErrorf(err, "", "remove-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlsRules : ActionControlsRules struct +type ActionControlsRules struct { + Add *bool `json:"add" validate:"required"` + + Remove *bool `json:"remove" validate:"required"` +} + +// NewActionControlsRules : Instantiate ActionControlsRules (Generic Model Constructor) +func (*IamIdentityV1) NewActionControlsRules(add bool, remove bool) (_model *ActionControlsRules, err error) { + _model = &ActionControlsRules{ + Add: core.BoolPtr(add), + Remove: core.BoolPtr(remove), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalActionControlsRules unmarshals an instance of ActionControlsRules from the specified map of raw messages. +func UnmarshalActionControlsRules(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlsRules) + err = core.UnmarshalPrimitive(m, "add", &obj.Add) + if err != nil { + err = core.SDKErrorf(err, "", "add-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "remove", &obj.Remove) + if err != nil { + err = core.SDKErrorf(err, "", "remove-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // Activity : Activity struct type Activity struct { // Time when the entity was last authenticated. @@ -6862,7 +7606,7 @@ type CommitAccountSettingsTemplateOptions struct { // Version of the account settings template. Version *string `json:"version" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -6900,7 +7644,7 @@ type CommitProfileTemplateOptions struct { // Version of the Profile Template. Version *string `json:"version" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -6944,7 +7688,7 @@ type CreateAccountSettingsAssignmentOptions struct { // Identifier of target to deploy to. Target *string `json:"target" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7008,7 +7752,7 @@ type CreateAccountSettingsTemplateOptions struct { AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7063,7 +7807,7 @@ type CreateAccountSettingsTemplateVersionOptions struct { AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7150,7 +7894,7 @@ type CreateAPIKeyOptions struct { // Indicates if the API key is disabled. False by default. EntityDisable *string `json:"Entity-Disable,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7256,7 +8000,7 @@ type CreateClaimRuleOptions struct { // Session expiration in seconds, only required if type is 'Profile-SAML'. Expiration *int64 `json:"expiration,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7337,7 +8081,7 @@ type CreateLinkOptions struct { // Optional name of the Link. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7388,7 +8132,7 @@ type CreateMfaReportOptions struct { // Optional report type. The supported value is 'mfa_status'. List MFA enrollment status for all the identities. Type *string `json:"type,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7477,7 +8221,7 @@ type CreateProfileOptions struct { // provided during creation of trusted profile. Description *string `json:"description,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7532,7 +8276,9 @@ type CreateProfileTemplateOptions struct { // Existing policy templates that you can reference to assign access in the trusted profile component. PolicyTemplateReferences []PolicyTemplateReference `json:"policy_template_references,omitempty"` - // Allows users to set headers on API requests + ActionControls *ActionControls `json:"action_controls,omitempty"` + + // Allows users to set headers on API requests. Headers map[string]string } @@ -7571,6 +8317,12 @@ func (_options *CreateProfileTemplateOptions) SetPolicyTemplateReferences(policy return _options } +// SetActionControls : Allow user to set ActionControls +func (_options *CreateProfileTemplateOptions) SetActionControls(actionControls *ActionControls) *CreateProfileTemplateOptions { + _options.ActionControls = actionControls + return _options +} + // SetHeaders : Allow user to set Headers func (options *CreateProfileTemplateOptions) SetHeaders(param map[string]string) *CreateProfileTemplateOptions { options.Headers = param @@ -7599,7 +8351,9 @@ type CreateProfileTemplateVersionOptions struct { // Existing policy templates that you can reference to assign access in the trusted profile component. PolicyTemplateReferences []PolicyTemplateReference `json:"policy_template_references,omitempty"` - // Allows users to set headers on API requests + ActionControls *ActionControls `json:"action_controls,omitempty"` + + // Allows users to set headers on API requests. Headers map[string]string } @@ -7646,6 +8400,12 @@ func (_options *CreateProfileTemplateVersionOptions) SetPolicyTemplateReferences return _options } +// SetActionControls : Allow user to set ActionControls +func (_options *CreateProfileTemplateVersionOptions) SetActionControls(actionControls *ActionControls) *CreateProfileTemplateVersionOptions { + _options.ActionControls = actionControls + return _options +} + // SetHeaders : Allow user to set Headers func (options *CreateProfileTemplateVersionOptions) SetHeaders(param map[string]string) *CreateProfileTemplateVersionOptions { options.Headers = param @@ -7664,7 +8424,7 @@ type CreateReportOptions struct { // Optional duration of the report. The supported unit of duration is hours. Duration *string `json:"duration,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7721,7 +8481,7 @@ type CreateServiceIDOptions struct { // Indicates if the service ID is locked for further write operations. False by default. EntityLock *string `json:"Entity-Lock,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7789,7 +8549,7 @@ type CreateTrustedProfileAssignmentOptions struct { // Identifier of target to deploy to. Target *string `json:"target" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7845,7 +8605,7 @@ type DeleteAccountSettingsAssignmentOptions struct { // ID of the Assignment Record. AssignmentID *string `json:"assignment_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7876,7 +8636,7 @@ type DeleteAccountSettingsTemplateVersionOptions struct { // Version of the account settings template. Version *string `json:"version" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7911,7 +8671,7 @@ type DeleteAllVersionsOfAccountSettingsTemplateOptions struct { // ID of the account settings template. TemplateID *string `json:"template_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7939,7 +8699,7 @@ type DeleteAllVersionsOfProfileTemplateOptions struct { // ID of the trusted profile template. TemplateID *string `json:"template_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7967,7 +8727,7 @@ type DeleteAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -7998,7 +8758,7 @@ type DeleteClaimRuleOptions struct { // ID of the claim rule to delete. RuleID *string `json:"rule-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8036,7 +8796,7 @@ type DeleteLinkOptions struct { // ID of the link. LinkID *string `json:"link-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8077,7 +8837,7 @@ type DeleteProfileIdentityOptions struct { // Identifier of the identity that can assume the trusted profiles. IdentifierID *string `json:"identifier-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8127,7 +8887,7 @@ type DeleteProfileOptions struct { // ID of the trusted profile. ProfileID *string `json:"profile-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8158,7 +8918,7 @@ type DeleteProfileTemplateVersionOptions struct { // Version of the Profile Template. Version *string `json:"version" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8193,7 +8953,7 @@ type DeleteServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8221,7 +8981,7 @@ type DeleteTrustedProfileAssignmentOptions struct { // ID of the Assignment Record. AssignmentID *string `json:"assignment_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8249,7 +9009,7 @@ type DisableAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8272,12 +9032,144 @@ func (options *DisableAPIKeyOptions) SetHeaders(param map[string]string) *Disabl return options } +// EffectiveAccountSettingsResponse : Response body format for Account Settings REST requests. +type EffectiveAccountSettingsResponse struct { + // Context with key properties for problem determination. + Context *ResponseContext `json:"context,omitempty"` + + // Unique ID of the account. + AccountID *string `json:"account_id" validate:"required"` + + Effective *AccountSettingsEffectiveSection `json:"effective" validate:"required"` + + Account *AccountSettingsAccountSection `json:"account" validate:"required"` + + // assigned template section. + AssignedTemplates []AccountSettingsAssignedTemplatesSection `json:"assigned_templates,omitempty"` +} + +// UnmarshalEffectiveAccountSettingsResponse unmarshals an instance of EffectiveAccountSettingsResponse from the specified map of raw messages. +func UnmarshalEffectiveAccountSettingsResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EffectiveAccountSettingsResponse) + err = core.UnmarshalModel(m, "context", &obj.Context, UnmarshalResponseContext) + if err != nil { + err = core.SDKErrorf(err, "", "context-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "effective", &obj.Effective, UnmarshalAccountSettingsEffectiveSection) + if err != nil { + err = core.SDKErrorf(err, "", "effective-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountSettingsAccountSection) + if err != nil { + err = core.SDKErrorf(err, "", "account-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "assigned_templates", &obj.AssignedTemplates, UnmarshalAccountSettingsAssignedTemplatesSection) + if err != nil { + err = core.SDKErrorf(err, "", "assigned_templates-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EffectiveAccountSettingsUserMfa : EffectiveAccountSettingsUserMfa struct +type EffectiveAccountSettingsUserMfa struct { + // The iam_id of the user. + IamID *string `json:"iam_id" validate:"required"` + + // Defines the MFA requirement for the user. Valid values: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * TOTP - For all non-federated IBMId users + // * TOTP4ALL - For all users + // * LEVEL1 - Email-based MFA for all users + // * LEVEL2 - TOTP-based MFA for all users + // * LEVEL3 - U2F MFA for all users. + Mfa *string `json:"mfa" validate:"required"` + + // name of the user account. + Name *string `json:"name,omitempty"` + + // userName of the user. + UserName *string `json:"userName,omitempty"` + + // email of the user. + Email *string `json:"email,omitempty"` + + // optional description. + Description *string `json:"description,omitempty"` +} + +// Constants associated with the EffectiveAccountSettingsUserMfa.Mfa property. +// Defines the MFA requirement for the user. Valid values: +// - NONE - No MFA trait set +// - NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// - TOTP - For all non-federated IBMId users +// - TOTP4ALL - For all users +// - LEVEL1 - Email-based MFA for all users +// - LEVEL2 - TOTP-based MFA for all users +// - LEVEL3 - U2F MFA for all users. +const ( + EffectiveAccountSettingsUserMfaMfaLevel1Const = "LEVEL1" + EffectiveAccountSettingsUserMfaMfaLevel2Const = "LEVEL2" + EffectiveAccountSettingsUserMfaMfaLevel3Const = "LEVEL3" + EffectiveAccountSettingsUserMfaMfaNoneConst = "NONE" + EffectiveAccountSettingsUserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" + EffectiveAccountSettingsUserMfaMfaTotpConst = "TOTP" + EffectiveAccountSettingsUserMfaMfaTotp4allConst = "TOTP4ALL" +) + +// UnmarshalEffectiveAccountSettingsUserMfa unmarshals an instance of EffectiveAccountSettingsUserMfa from the specified map of raw messages. +func UnmarshalEffectiveAccountSettingsUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EffectiveAccountSettingsUserMfa) + err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "userName", &obj.UserName) + if err != nil { + err = core.SDKErrorf(err, "", "userName-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "email", &obj.Email) + if err != nil { + err = core.SDKErrorf(err, "", "email-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EnableAPIKeyOptions : The EnableAPIKey options. type EnableAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8486,7 +9378,7 @@ type GetAccountSettingsAssignmentOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8523,7 +9415,7 @@ type GetAccountSettingsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8563,7 +9455,7 @@ type GetAccountSettingsTemplateVersionOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8611,7 +9503,7 @@ type GetAPIKeyOptions struct { // only request this when needed. IncludeActivity *bool `json:"include_activity,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8654,7 +9546,7 @@ type GetAPIKeysDetailsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8689,7 +9581,7 @@ type GetClaimRuleOptions struct { // ID of the claim rule to get. RuleID *string `json:"rule-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8719,6 +9611,52 @@ func (options *GetClaimRuleOptions) SetHeaders(param map[string]string) *GetClai return options } +// GetEffectiveAccountSettingsOptions : The GetEffectiveAccountSettings options. +type GetEffectiveAccountSettingsOptions struct { + // Unique ID of the account. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Defines if the entity history is included in the response. + IncludeHistory *bool `json:"include_history,omitempty"` + + // Enrich MFA exemptions with user information. + ResolveUserMfa *bool `json:"resolve_user_mfa,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetEffectiveAccountSettingsOptions : Instantiate GetEffectiveAccountSettingsOptions +func (*IamIdentityV1) NewGetEffectiveAccountSettingsOptions(accountID string) *GetEffectiveAccountSettingsOptions { + return &GetEffectiveAccountSettingsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *GetEffectiveAccountSettingsOptions) SetAccountID(accountID string) *GetEffectiveAccountSettingsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetIncludeHistory : Allow user to set IncludeHistory +func (_options *GetEffectiveAccountSettingsOptions) SetIncludeHistory(includeHistory bool) *GetEffectiveAccountSettingsOptions { + _options.IncludeHistory = core.BoolPtr(includeHistory) + return _options +} + +// SetResolveUserMfa : Allow user to set ResolveUserMfa +func (_options *GetEffectiveAccountSettingsOptions) SetResolveUserMfa(resolveUserMfa bool) *GetEffectiveAccountSettingsOptions { + _options.ResolveUserMfa = core.BoolPtr(resolveUserMfa) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetEffectiveAccountSettingsOptions) SetHeaders(param map[string]string) *GetEffectiveAccountSettingsOptions { + options.Headers = param + return options +} + // GetLatestAccountSettingsTemplateVersionOptions : The GetLatestAccountSettingsTemplateVersion options. type GetLatestAccountSettingsTemplateVersionOptions struct { // ID of the account settings template. @@ -8727,7 +9665,7 @@ type GetLatestAccountSettingsTemplateVersionOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8764,7 +9702,7 @@ type GetLatestProfileTemplateVersionOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8801,7 +9739,7 @@ type GetLinkOptions struct { // ID of the link. LinkID *string `json:"link-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8839,7 +9777,7 @@ type GetMfaReportOptions struct { // Reference for the report to be generated, You can use 'latest' to get the latest report for the given account. Reference *string `json:"reference" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8877,7 +9815,7 @@ type GetMfaStatusOptions struct { // iam_id of the user. This user must be the member of the account. IamID *string `json:"iam_id" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8912,7 +9850,7 @@ type GetProfileIdentitiesOptions struct { // ID of the trusted profile. ProfileID *string `json:"profile-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8946,7 +9884,7 @@ type GetProfileIdentityOptions struct { // Identifier of the identity that can assume the trusted profiles. IdentifierID *string `json:"identifier-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9000,7 +9938,7 @@ type GetProfileOptions struct { // only request this when needed. IncludeActivity *bool `json:"include_activity,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9040,7 +9978,7 @@ type GetProfileTemplateVersionOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9084,7 +10022,7 @@ type GetReportOptions struct { // Reference for the report to be generated, You can use 'latest' to get the latest report for the given account. Reference *string `json:"reference" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9126,7 +10064,7 @@ type GetServiceIDOptions struct { // only request this when needed. IncludeActivity *bool `json:"include_activity,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9169,7 +10107,7 @@ type GetTrustedProfileAssignmentOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9375,7 +10313,7 @@ type ListAccountSettingsAssignmentsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9492,7 +10430,7 @@ type ListAccountSettingsTemplatesOptions struct { // Defines if the entity history is included in the response. IncludeHistory *string `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9591,7 +10529,7 @@ type ListAPIKeysOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9686,7 +10624,7 @@ type ListClaimRulesOptions struct { // ID of the trusted profile. ProfileID *string `json:"profile-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9714,7 +10652,7 @@ type ListLinksOptions struct { // ID of the trusted profile. ProfileID *string `json:"profile-id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9757,7 +10695,7 @@ type ListProfileTemplatesOptions struct { // Defines if the entity history is included in the response. IncludeHistory *string `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9847,7 +10785,7 @@ type ListProfilesOptions struct { // Optional Prev or Next page token returned from a previous query execution. Default is start with first page. Pagetoken *string `json:"pagetoken,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -9937,7 +10875,7 @@ type ListServiceIdsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10033,7 +10971,7 @@ type ListTrustedProfileAssignmentsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10150,7 +11088,7 @@ type ListVersionsOfAccountSettingsTemplateOptions struct { // Defines if the entity history is included in the response. IncludeHistory *string `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10238,7 +11176,7 @@ type ListVersionsOfProfileTemplateOptions struct { // Defines if the entity history is included in the response. IncludeHistory *string `json:"include_history,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10311,7 +11249,7 @@ type LockAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10339,7 +11277,7 @@ type LockServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11367,7 +12305,7 @@ type SetProfileIdentitiesOptions struct { // List of identities that can assume the trusted profile. Identities []ProfileIdentityRequest `json:"identities,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11427,7 +12365,7 @@ type SetProfileIdentityOptions struct { // used. Description is recommended for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'. Description *string `json:"description,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12260,6 +13198,8 @@ type TrustedProfileTemplateResponse struct { // Existing policy templates that you can reference to assign access in the trusted profile component. PolicyTemplateReferences []PolicyTemplateReference `json:"policy_template_references,omitempty"` + ActionControls *ActionControls `json:"action_controls,omitempty"` + // History of the trusted profile template. History []EnityHistoryRecord `json:"history,omitempty"` @@ -12325,6 +13265,11 @@ func UnmarshalTrustedProfileTemplateResponse(m map[string]json.RawMessage, resul err = core.SDKErrorf(err, "", "policy_template_references-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "action_controls", &obj.ActionControls, UnmarshalActionControls) + if err != nil { + err = core.SDKErrorf(err, "", "action_controls-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) if err != nil { err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) @@ -12436,7 +13381,7 @@ type UnlockAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12464,7 +13409,7 @@ type UnlockServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12501,7 +13446,7 @@ type UpdateAccountSettingsAssignmentOptions struct { // migrate to a different version, provide the new version number. TemplateVersion *int64 `json:"template_version" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12603,7 +13548,7 @@ type UpdateAccountSettingsOptions struct { // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12762,7 +13707,7 @@ type UpdateAccountSettingsTemplateVersionOptions struct { AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12847,7 +13792,7 @@ type UpdateAPIKeyOptions struct { // Defines the action to take when API key is leaked, valid values are 'none', 'disable' and 'delete'. ActionWhenLeaked *string `json:"action_when_leaked,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12937,7 +13882,7 @@ type UpdateClaimRuleOptions struct { // Session expiration in seconds, only required if type is 'Profile-SAML'. Expiration *int64 `json:"expiration,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13036,7 +13981,7 @@ type UpdateProfileOptions struct { // the trusted profile. If a non empty value is provided the trusted profile will be updated. Description *string `json:"description,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13108,7 +14053,9 @@ type UpdateProfileTemplateVersionOptions struct { // Existing policy templates that you can reference to assign access in the trusted profile component. PolicyTemplateReferences []PolicyTemplateReference `json:"policy_template_references,omitempty"` - // Allows users to set headers on API requests + ActionControls *ActionControls `json:"action_controls,omitempty"` + + // Allows users to set headers on API requests. Headers map[string]string } @@ -13169,6 +14116,12 @@ func (_options *UpdateProfileTemplateVersionOptions) SetPolicyTemplateReferences return _options } +// SetActionControls : Allow user to set ActionControls +func (_options *UpdateProfileTemplateVersionOptions) SetActionControls(actionControls *ActionControls) *UpdateProfileTemplateVersionOptions { + _options.ActionControls = actionControls + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateProfileTemplateVersionOptions) SetHeaders(param map[string]string) *UpdateProfileTemplateVersionOptions { options.Headers = param @@ -13197,7 +14150,7 @@ type UpdateServiceIDOptions struct { // existing unique instance crns of the service ID. UniqueInstanceCrns []string `json:"unique_instance_crns,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13259,7 +14212,7 @@ type UpdateTrustedProfileAssignmentOptions struct { // migrate to a different version, provide the new version number. TemplateVersion *int64 `json:"template_version" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } diff --git a/iamidentityv1/iam_identity_v1_examples_test.go b/iamidentityv1/iam_identity_v1_examples_test.go index a0f19328..19fbaab2 100644 --- a/iamidentityv1/iam_identity_v1_examples_test.go +++ b/iamidentityv1/iam_identity_v1_examples_test.go @@ -1,7 +1,7 @@ //go:build examples /** - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2020, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -981,6 +981,25 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) Expect(accountSettingsResponse).ToNot(BeNil()) }) + It(`GetEffectiveAccountSettings request example`, func() { + fmt.Println("\nGetEffectiveAccountSettings() result:") + // begin-getEffectiveAccountSettings + + getEffectiveAccountSettingsOptions := iamIdentityService.NewGetEffectiveAccountSettingsOptions(accountID) + + effectiveAccountSettingsResponse, response, err := iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(effectiveAccountSettingsResponse, "", " ") + fmt.Println(string(b)) + + // end-getEffectiveAccountSettings + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(effectiveAccountSettingsResponse).ToNot(BeNil()) + }) It(`CreateReport request example`, func() { fmt.Println("\nCreateReport() result:") // begin-create_report diff --git a/iamidentityv1/iam_identity_v1_integration_test.go b/iamidentityv1/iam_identity_v1_integration_test.go index 5dab15a5..02058768 100644 --- a/iamidentityv1/iam_identity_v1_integration_test.go +++ b/iamidentityv1/iam_identity_v1_integration_test.go @@ -1,7 +1,7 @@ //go:build integration /** - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2020, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1549,6 +1549,28 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) }) + Describe(`GetEffectiveAccountSettings - Get effective account settings configurations`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`GetEffectiveAccountSettings(getEffectiveAccountSettingsOptions *GetEffectiveAccountSettingsOptions)`, func() { + + getEffectiveAccountSettingsOptions := &iamidentityv1.GetEffectiveAccountSettingsOptions{ + AccountID: core.StringPtr(accountID), + IncludeHistory: core.BoolPtr(true), + } + + effectiveAccountSettingsResponse, response, err := iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptions) + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(effectiveAccountSettingsResponse).ToNot(BeNil()) + Expect(effectiveAccountSettingsResponse.AccountID).ToNot(BeNil()) + Expect(effectiveAccountSettingsResponse.Effective).ToNot(BeNil()) + Expect(effectiveAccountSettingsResponse.Account).ToNot(BeNil()) + }) + }) + Describe(`CreateInactivityReport - Create an inactivity report`, func() { BeforeEach(func() { shouldSkipTest() diff --git a/iamidentityv1/iam_identity_v1_test.go b/iamidentityv1/iam_identity_v1_test.go index a9bcbc7b..339d0a75 100644 --- a/iamidentityv1/iam_identity_v1_test.go +++ b/iamidentityv1/iam_identity_v1_test.go @@ -19,6 +19,7 @@ package iamidentityv1_test import ( "bytes" "context" + "encoding/base64" "encoding/json" "fmt" "io" @@ -67,14 +68,13 @@ var _ = Describe(`IamIdentityV1`, func() { Context(`Using external config, construct service client instances`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "IAM_IDENTITY_URL": "https://iamidentityv1/api", + "IAM_IDENTITY_URL": "https://iamidentityv1/api", "IAM_IDENTITY_AUTH_TYPE": "noauth", } It(`Create service client using external config successfully`, func() { SetTestEnvironment(testEnvironment) - iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1UsingExternalConfig(&iamidentityv1.IamIdentityV1Options{ - }) + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1UsingExternalConfig(&iamidentityv1.IamIdentityV1Options{}) Expect(iamIdentityService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) @@ -103,8 +103,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) - iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1UsingExternalConfig(&iamidentityv1.IamIdentityV1Options{ - }) + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1UsingExternalConfig(&iamidentityv1.IamIdentityV1Options{}) err := iamIdentityService.SetServiceURL("https://testService/api") Expect(err).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) @@ -122,13 +121,12 @@ var _ = Describe(`IamIdentityV1`, func() { Context(`Using external config, construct service client instances with error: Invalid Auth`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "IAM_IDENTITY_URL": "https://iamidentityv1/api", + "IAM_IDENTITY_URL": "https://iamidentityv1/api", "IAM_IDENTITY_AUTH_TYPE": "someOtherAuth", } SetTestEnvironment(testEnvironment) - iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1UsingExternalConfig(&iamidentityv1.IamIdentityV1Options{ - }) + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1UsingExternalConfig(&iamidentityv1.IamIdentityV1Options{}) It(`Instantiate service client with error`, func() { Expect(iamIdentityService).To(BeNil()) @@ -139,7 +137,7 @@ var _ = Describe(`IamIdentityV1`, func() { Context(`Using external config, construct service client instances with error: Invalid URL`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "IAM_IDENTITY_AUTH_TYPE": "NOAuth", + "IAM_IDENTITY_AUTH_TYPE": "NOAuth", } SetTestEnvironment(testEnvironment) @@ -12370,6 +12368,234 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) + Describe(`GetEffectiveAccountSettings(getEffectiveAccountSettingsOptions *GetEffectiveAccountSettingsOptions) - Operation response error`, func() { + getEffectiveAccountSettingsPath := "/v1/accounts/testString/effective_settings/identity" + Context(`Using mock server endpoint with invalid JSON response`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() + + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getEffectiveAccountSettingsPath)) + Expect(req.Method).To(Equal("GET")) + // TODO: Add check for include_history query parameter + // TODO: Add check for resolve_user_mfa query parameter + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetEffectiveAccountSettings with error: Operation response processing error`, func() { + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamIdentityService).ToNot(BeNil()) + + // Construct an instance of the GetEffectiveAccountSettingsOptions model + getEffectiveAccountSettingsOptionsModel := new(iamidentityv1.GetEffectiveAccountSettingsOptions) + getEffectiveAccountSettingsOptionsModel.AccountID = core.StringPtr("testString") + getEffectiveAccountSettingsOptionsModel.IncludeHistory = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.ResolveUserMfa = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Expect response parsing to fail since we are receiving a text/plain response + result, response, operationErr := iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + iamIdentityService.EnableRetries(0, 0) + result, response, operationErr = iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetEffectiveAccountSettings(getEffectiveAccountSettingsOptions *GetEffectiveAccountSettingsOptions)`, func() { + getEffectiveAccountSettingsPath := "/v1/accounts/testString/effective_settings/identity" + Context(`Using mock server endpoint with timeout`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() + + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getEffectiveAccountSettingsPath)) + Expect(req.Method).To(Equal("GET")) + + // TODO: Add check for include_history query parameter + // TODO: Add check for resolve_user_mfa query parameter + // Sleep a short time to support a timeout test + time.Sleep(100 * time.Millisecond) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "account_id": "AccountID", "effective": {"restrict_create_service_id": "NOT_SET", "restrict_create_platform_apikey": "NOT_SET", "allowed_ip_addresses": "AllowedIPAddresses", "mfa": "NONE", "user_mfa": [{"iam_id": "IamID", "mfa": "NONE", "name": "Name", "userName": "UserName", "email": "Email", "description": "Description"}], "session_expiration_in_seconds": "86400", "session_invalidation_in_seconds": "7200", "max_sessions_per_identity": "MaxSessionsPerIdentity", "system_access_token_expiration_in_seconds": "3600", "system_refresh_token_expiration_in_seconds": "259200"}, "account": {"account_id": "AccountID", "restrict_create_service_id": "NOT_SET", "restrict_create_platform_apikey": "NOT_SET", "allowed_ip_addresses": "AllowedIPAddresses", "mfa": "NONE", "user_mfa": [{"iam_id": "IamID", "mfa": "NONE", "name": "Name", "userName": "UserName", "email": "Email", "description": "Description"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "session_expiration_in_seconds": "86400", "session_invalidation_in_seconds": "7200", "max_sessions_per_identity": "MaxSessionsPerIdentity", "system_access_token_expiration_in_seconds": "3600", "system_refresh_token_expiration_in_seconds": "259200"}, "assigned_templates": [{"template_id": "TemplateID", "template_version": 15, "template_name": "TemplateName", "restrict_create_service_id": "NOT_SET", "restrict_create_platform_apikey": "NOT_SET", "allowed_ip_addresses": "AllowedIPAddresses", "mfa": "NONE", "user_mfa": [{"iam_id": "IamID", "mfa": "NONE", "name": "Name", "userName": "UserName", "email": "Email", "description": "Description"}], "session_expiration_in_seconds": "86400", "session_invalidation_in_seconds": "7200", "max_sessions_per_identity": "MaxSessionsPerIdentity", "system_access_token_expiration_in_seconds": "3600", "system_refresh_token_expiration_in_seconds": "259200"}]}`) + })) + }) + It(`Invoke GetEffectiveAccountSettings successfully with retries`, func() { + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamIdentityService).ToNot(BeNil()) + iamIdentityService.EnableRetries(0, 0) + + // Construct an instance of the GetEffectiveAccountSettingsOptions model + getEffectiveAccountSettingsOptionsModel := new(iamidentityv1.GetEffectiveAccountSettingsOptions) + getEffectiveAccountSettingsOptionsModel.AccountID = core.StringPtr("testString") + getEffectiveAccountSettingsOptionsModel.IncludeHistory = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.ResolveUserMfa = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with a Context to test a timeout error + ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc() + _, _, operationErr := iamIdentityService.GetEffectiveAccountSettingsWithContext(ctx, getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + iamIdentityService.DisableRetries() + result, response, operationErr := iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + // Re-test the timeout error with retries disabled + ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc2() + _, _, operationErr = iamIdentityService.GetEffectiveAccountSettingsWithContext(ctx, getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() + + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getEffectiveAccountSettingsPath)) + Expect(req.Method).To(Equal("GET")) + + // TODO: Add check for include_history query parameter + // TODO: Add check for resolve_user_mfa query parameter + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "account_id": "AccountID", "effective": {"restrict_create_service_id": "NOT_SET", "restrict_create_platform_apikey": "NOT_SET", "allowed_ip_addresses": "AllowedIPAddresses", "mfa": "NONE", "user_mfa": [{"iam_id": "IamID", "mfa": "NONE", "name": "Name", "userName": "UserName", "email": "Email", "description": "Description"}], "session_expiration_in_seconds": "86400", "session_invalidation_in_seconds": "7200", "max_sessions_per_identity": "MaxSessionsPerIdentity", "system_access_token_expiration_in_seconds": "3600", "system_refresh_token_expiration_in_seconds": "259200"}, "account": {"account_id": "AccountID", "restrict_create_service_id": "NOT_SET", "restrict_create_platform_apikey": "NOT_SET", "allowed_ip_addresses": "AllowedIPAddresses", "mfa": "NONE", "user_mfa": [{"iam_id": "IamID", "mfa": "NONE", "name": "Name", "userName": "UserName", "email": "Email", "description": "Description"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "session_expiration_in_seconds": "86400", "session_invalidation_in_seconds": "7200", "max_sessions_per_identity": "MaxSessionsPerIdentity", "system_access_token_expiration_in_seconds": "3600", "system_refresh_token_expiration_in_seconds": "259200"}, "assigned_templates": [{"template_id": "TemplateID", "template_version": 15, "template_name": "TemplateName", "restrict_create_service_id": "NOT_SET", "restrict_create_platform_apikey": "NOT_SET", "allowed_ip_addresses": "AllowedIPAddresses", "mfa": "NONE", "user_mfa": [{"iam_id": "IamID", "mfa": "NONE", "name": "Name", "userName": "UserName", "email": "Email", "description": "Description"}], "session_expiration_in_seconds": "86400", "session_invalidation_in_seconds": "7200", "max_sessions_per_identity": "MaxSessionsPerIdentity", "system_access_token_expiration_in_seconds": "3600", "system_refresh_token_expiration_in_seconds": "259200"}]}`) + })) + }) + It(`Invoke GetEffectiveAccountSettings successfully`, func() { + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamIdentityService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := iamIdentityService.GetEffectiveAccountSettings(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the GetEffectiveAccountSettingsOptions model + getEffectiveAccountSettingsOptionsModel := new(iamidentityv1.GetEffectiveAccountSettingsOptions) + getEffectiveAccountSettingsOptionsModel.AccountID = core.StringPtr("testString") + getEffectiveAccountSettingsOptionsModel.IncludeHistory = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.ResolveUserMfa = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke GetEffectiveAccountSettings with error: Operation validation and request error`, func() { + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamIdentityService).ToNot(BeNil()) + + // Construct an instance of the GetEffectiveAccountSettingsOptions model + getEffectiveAccountSettingsOptionsModel := new(iamidentityv1.GetEffectiveAccountSettingsOptions) + getEffectiveAccountSettingsOptionsModel.AccountID = core.StringPtr("testString") + getEffectiveAccountSettingsOptionsModel.IncludeHistory = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.ResolveUserMfa = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := iamIdentityService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + // Construct a second instance of the GetEffectiveAccountSettingsOptions model with no property values + getEffectiveAccountSettingsOptionsModelNew := new(iamidentityv1.GetEffectiveAccountSettingsOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Using mock server endpoint with missing response body`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() + + // Set success status code with no respoonse body + res.WriteHeader(200) + })) + }) + It(`Invoke GetEffectiveAccountSettings successfully`, func() { + iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamIdentityService).ToNot(BeNil()) + + // Construct an instance of the GetEffectiveAccountSettingsOptions model + getEffectiveAccountSettingsOptionsModel := new(iamidentityv1.GetEffectiveAccountSettingsOptions) + getEffectiveAccountSettingsOptionsModel.AccountID = core.StringPtr("testString") + getEffectiveAccountSettingsOptionsModel.IncludeHistory = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.ResolveUserMfa = core.BoolPtr(false) + getEffectiveAccountSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := iamIdentityService.GetEffectiveAccountSettings(getEffectiveAccountSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) Describe(`ListTrustedProfileAssignments(listTrustedProfileAssignmentsOptions *ListTrustedProfileAssignmentsOptions) - Operation response error`, func() { listTrustedProfileAssignmentsPath := "/v1/profile_assignments/" Context(`Using mock server endpoint with invalid JSON response`, func() { @@ -13680,7 +13906,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) })) }) It(`Invoke ListProfileTemplates successfully with retries`, func() { @@ -13745,7 +13971,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) })) }) It(`Invoke ListProfileTemplates successfully`, func() { @@ -13905,6 +14131,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateOptions model createProfileTemplateOptionsModel := new(iamidentityv1.CreateProfileTemplateOptions) createProfileTemplateOptionsModel.AccountID = core.StringPtr("testString") @@ -13912,6 +14159,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateOptionsModel.Description = core.StringPtr("testString") createProfileTemplateOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateOptionsModel.ActionControls = actionControlsModel createProfileTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := iamIdentityService.CreateProfileTemplate(createProfileTemplateOptionsModel) @@ -13964,7 +14212,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke CreateProfileTemplate successfully with retries`, func() { @@ -14009,6 +14257,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateOptions model createProfileTemplateOptionsModel := new(iamidentityv1.CreateProfileTemplateOptions) createProfileTemplateOptionsModel.AccountID = core.StringPtr("testString") @@ -14016,6 +14285,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateOptionsModel.Description = core.StringPtr("testString") createProfileTemplateOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateOptionsModel.ActionControls = actionControlsModel createProfileTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -14071,7 +14341,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke CreateProfileTemplate successfully`, func() { @@ -14121,6 +14391,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateOptions model createProfileTemplateOptionsModel := new(iamidentityv1.CreateProfileTemplateOptions) createProfileTemplateOptionsModel.AccountID = core.StringPtr("testString") @@ -14128,6 +14419,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateOptionsModel.Description = core.StringPtr("testString") createProfileTemplateOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateOptionsModel.ActionControls = actionControlsModel createProfileTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -14178,6 +14470,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateOptions model createProfileTemplateOptionsModel := new(iamidentityv1.CreateProfileTemplateOptions) createProfileTemplateOptionsModel.AccountID = core.StringPtr("testString") @@ -14185,6 +14498,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateOptionsModel.Description = core.StringPtr("testString") createProfileTemplateOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateOptionsModel.ActionControls = actionControlsModel createProfileTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") @@ -14249,6 +14563,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateOptions model createProfileTemplateOptionsModel := new(iamidentityv1.CreateProfileTemplateOptions) createProfileTemplateOptionsModel.AccountID = core.StringPtr("testString") @@ -14256,6 +14591,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateOptionsModel.Description = core.StringPtr("testString") createProfileTemplateOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateOptionsModel.ActionControls = actionControlsModel createProfileTemplateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -14336,7 +14672,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke GetLatestProfileTemplateVersion successfully with retries`, func() { @@ -14392,7 +14728,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke GetLatestProfileTemplateVersion successfully`, func() { @@ -14636,7 +14972,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) })) }) It(`Invoke ListVersionsOfProfileTemplate successfully with retries`, func() { @@ -14700,7 +15036,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 20, "first": "First", "previous": "Previous", "next": "Next", "profile_templates": [{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}]}`) })) }) It(`Invoke ListVersionsOfProfileTemplate successfully`, func() { @@ -14867,6 +15203,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateVersionOptions model createProfileTemplateVersionOptionsModel := new(iamidentityv1.CreateProfileTemplateVersionOptions) createProfileTemplateVersionOptionsModel.TemplateID = core.StringPtr("testString") @@ -14875,6 +15232,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") createProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel createProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := iamIdentityService.CreateProfileTemplateVersion(createProfileTemplateVersionOptionsModel) @@ -14927,7 +15285,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke CreateProfileTemplateVersion successfully with retries`, func() { @@ -14972,6 +15330,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateVersionOptions model createProfileTemplateVersionOptionsModel := new(iamidentityv1.CreateProfileTemplateVersionOptions) createProfileTemplateVersionOptionsModel.TemplateID = core.StringPtr("testString") @@ -14980,6 +15359,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") createProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel createProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -15035,7 +15415,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke CreateProfileTemplateVersion successfully`, func() { @@ -15085,6 +15465,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateVersionOptions model createProfileTemplateVersionOptionsModel := new(iamidentityv1.CreateProfileTemplateVersionOptions) createProfileTemplateVersionOptionsModel.TemplateID = core.StringPtr("testString") @@ -15093,6 +15494,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") createProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel createProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -15143,6 +15545,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateVersionOptions model createProfileTemplateVersionOptionsModel := new(iamidentityv1.CreateProfileTemplateVersionOptions) createProfileTemplateVersionOptionsModel.TemplateID = core.StringPtr("testString") @@ -15151,6 +15574,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") createProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel createProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") @@ -15222,6 +15646,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the CreateProfileTemplateVersionOptions model createProfileTemplateVersionOptionsModel := new(iamidentityv1.CreateProfileTemplateVersionOptions) createProfileTemplateVersionOptionsModel.TemplateID = core.StringPtr("testString") @@ -15230,6 +15675,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") createProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel createProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + createProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel createProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -15311,7 +15757,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke GetProfileTemplateVersion successfully with retries`, func() { @@ -15368,7 +15814,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke GetProfileTemplateVersion successfully`, func() { @@ -15528,6 +15974,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the UpdateProfileTemplateVersionOptions model updateProfileTemplateVersionOptionsModel := new(iamidentityv1.UpdateProfileTemplateVersionOptions) updateProfileTemplateVersionOptionsModel.IfMatch = core.StringPtr("testString") @@ -15538,6 +16005,7 @@ var _ = Describe(`IamIdentityV1`, func() { updateProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") updateProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel updateProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + updateProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel updateProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := iamIdentityService.UpdateProfileTemplateVersion(updateProfileTemplateVersionOptionsModel) @@ -15592,7 +16060,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke UpdateProfileTemplateVersion successfully with retries`, func() { @@ -15637,6 +16105,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the UpdateProfileTemplateVersionOptions model updateProfileTemplateVersionOptionsModel := new(iamidentityv1.UpdateProfileTemplateVersionOptions) updateProfileTemplateVersionOptionsModel.IfMatch = core.StringPtr("testString") @@ -15647,6 +16136,7 @@ var _ = Describe(`IamIdentityV1`, func() { updateProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") updateProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel updateProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + updateProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel updateProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -15704,7 +16194,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "version": 7, "account_id": "AccountID", "name": "Name", "description": "Description", "committed": false, "profile": {"name": "Name", "description": "Description", "rules": [{"name": "Name", "type": "Profile-SAML", "realm_name": "RealmName", "expiration": 10, "conditions": [{"claim": "Claim", "operator": "Operator", "value": "Value"}]}], "identities": [{"iam_id": "IamID", "identifier": "Identifier", "type": "user", "accounts": ["Accounts"], "description": "Description"}]}, "policy_template_references": [{"id": "ID", "version": "Version"}], "action_controls": {"identities": {"add": false, "remove": true}, "rules": {"add": false, "remove": true}, "policies": {"add": false, "remove": true}}, "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "entity_tag": "EntityTag", "crn": "CRN", "created_at": "CreatedAt", "created_by_id": "CreatedByID", "last_modified_at": "LastModifiedAt", "last_modified_by_id": "LastModifiedByID"}`) })) }) It(`Invoke UpdateProfileTemplateVersion successfully`, func() { @@ -15754,6 +16244,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the UpdateProfileTemplateVersionOptions model updateProfileTemplateVersionOptionsModel := new(iamidentityv1.UpdateProfileTemplateVersionOptions) updateProfileTemplateVersionOptionsModel.IfMatch = core.StringPtr("testString") @@ -15764,6 +16275,7 @@ var _ = Describe(`IamIdentityV1`, func() { updateProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") updateProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel updateProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + updateProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel updateProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -15814,6 +16326,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the UpdateProfileTemplateVersionOptions model updateProfileTemplateVersionOptionsModel := new(iamidentityv1.UpdateProfileTemplateVersionOptions) updateProfileTemplateVersionOptionsModel.IfMatch = core.StringPtr("testString") @@ -15824,6 +16357,7 @@ var _ = Describe(`IamIdentityV1`, func() { updateProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") updateProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel updateProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + updateProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel updateProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") @@ -15895,6 +16429,27 @@ var _ = Describe(`IamIdentityV1`, func() { policyTemplateReferenceModel.ID = core.StringPtr("testString") policyTemplateReferenceModel.Version = core.StringPtr("testString") + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + // Construct an instance of the UpdateProfileTemplateVersionOptions model updateProfileTemplateVersionOptionsModel := new(iamidentityv1.UpdateProfileTemplateVersionOptions) updateProfileTemplateVersionOptionsModel.IfMatch = core.StringPtr("testString") @@ -15905,6 +16460,7 @@ var _ = Describe(`IamIdentityV1`, func() { updateProfileTemplateVersionOptionsModel.Description = core.StringPtr("testString") updateProfileTemplateVersionOptionsModel.Profile = templateProfileComponentRequestModel updateProfileTemplateVersionOptionsModel.PolicyTemplateReferences = []iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel} + updateProfileTemplateVersionOptionsModel.ActionControls = actionControlsModel updateProfileTemplateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -16073,6 +16629,33 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) + It(`Invoke NewActionControls successfully`, func() { + var rules *iamidentityv1.ActionControlsRules = nil + var policies *iamidentityv1.ActionControlsPolicies = nil + _, err := iamIdentityService.NewActionControls(rules, policies) + Expect(err).ToNot(BeNil()) + }) + It(`Invoke NewActionControlsIdentities successfully`, func() { + add := true + remove := true + _model, err := iamIdentityService.NewActionControlsIdentities(add, remove) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) + It(`Invoke NewActionControlsPolicies successfully`, func() { + add := true + remove := true + _model, err := iamIdentityService.NewActionControlsPolicies(add, remove) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) + It(`Invoke NewActionControlsRules successfully`, func() { + add := true + remove := true + _model, err := iamIdentityService.NewActionControlsRules(add, remove) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) It(`Invoke NewAPIKeyInsideCreateServiceIDRequest successfully`, func() { name := "testString" _model, err := iamIdentityService.NewAPIKeyInsideCreateServiceIDRequest(name) @@ -16431,6 +17014,40 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(policyTemplateReferenceModel.ID).To(Equal(core.StringPtr("testString"))) Expect(policyTemplateReferenceModel.Version).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + Expect(actionControlsIdentitiesModel).ToNot(BeNil()) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + Expect(actionControlsIdentitiesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsIdentitiesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + Expect(actionControlsRulesModel).ToNot(BeNil()) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + Expect(actionControlsRulesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsRulesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + Expect(actionControlsPoliciesModel).ToNot(BeNil()) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + Expect(actionControlsPoliciesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsPoliciesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + Expect(actionControlsModel).ToNot(BeNil()) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + Expect(actionControlsModel.Identities).To(Equal(actionControlsIdentitiesModel)) + Expect(actionControlsModel.Rules).To(Equal(actionControlsRulesModel)) + Expect(actionControlsModel.Policies).To(Equal(actionControlsPoliciesModel)) + // Construct an instance of the CreateProfileTemplateOptions model createProfileTemplateOptionsModel := iamIdentityService.NewCreateProfileTemplateOptions() createProfileTemplateOptionsModel.SetAccountID("testString") @@ -16438,6 +17055,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateOptionsModel.SetDescription("testString") createProfileTemplateOptionsModel.SetProfile(templateProfileComponentRequestModel) createProfileTemplateOptionsModel.SetPolicyTemplateReferences([]iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel}) + createProfileTemplateOptionsModel.SetActionControls(actionControlsModel) createProfileTemplateOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createProfileTemplateOptionsModel).ToNot(BeNil()) Expect(createProfileTemplateOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) @@ -16445,6 +17063,7 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(createProfileTemplateOptionsModel.Description).To(Equal(core.StringPtr("testString"))) Expect(createProfileTemplateOptionsModel.Profile).To(Equal(templateProfileComponentRequestModel)) Expect(createProfileTemplateOptionsModel.PolicyTemplateReferences).To(Equal([]iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel})) + Expect(createProfileTemplateOptionsModel.ActionControls).To(Equal(actionControlsModel)) Expect(createProfileTemplateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCreateProfileTemplateVersionOptions successfully`, func() { @@ -16504,6 +17123,40 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(policyTemplateReferenceModel.ID).To(Equal(core.StringPtr("testString"))) Expect(policyTemplateReferenceModel.Version).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + Expect(actionControlsIdentitiesModel).ToNot(BeNil()) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + Expect(actionControlsIdentitiesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsIdentitiesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + Expect(actionControlsRulesModel).ToNot(BeNil()) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + Expect(actionControlsRulesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsRulesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + Expect(actionControlsPoliciesModel).ToNot(BeNil()) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + Expect(actionControlsPoliciesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsPoliciesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + Expect(actionControlsModel).ToNot(BeNil()) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + Expect(actionControlsModel.Identities).To(Equal(actionControlsIdentitiesModel)) + Expect(actionControlsModel.Rules).To(Equal(actionControlsRulesModel)) + Expect(actionControlsModel.Policies).To(Equal(actionControlsPoliciesModel)) + // Construct an instance of the CreateProfileTemplateVersionOptions model templateID := "testString" createProfileTemplateVersionOptionsModel := iamIdentityService.NewCreateProfileTemplateVersionOptions(templateID) @@ -16513,6 +17166,7 @@ var _ = Describe(`IamIdentityV1`, func() { createProfileTemplateVersionOptionsModel.SetDescription("testString") createProfileTemplateVersionOptionsModel.SetProfile(templateProfileComponentRequestModel) createProfileTemplateVersionOptionsModel.SetPolicyTemplateReferences([]iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel}) + createProfileTemplateVersionOptionsModel.SetActionControls(actionControlsModel) createProfileTemplateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createProfileTemplateVersionOptionsModel).ToNot(BeNil()) Expect(createProfileTemplateVersionOptionsModel.TemplateID).To(Equal(core.StringPtr("testString"))) @@ -16521,6 +17175,7 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(createProfileTemplateVersionOptionsModel.Description).To(Equal(core.StringPtr("testString"))) Expect(createProfileTemplateVersionOptionsModel.Profile).To(Equal(templateProfileComponentRequestModel)) Expect(createProfileTemplateVersionOptionsModel.PolicyTemplateReferences).To(Equal([]iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel})) + Expect(createProfileTemplateVersionOptionsModel.ActionControls).To(Equal(actionControlsModel)) Expect(createProfileTemplateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCreateReportOptions successfully`, func() { @@ -16824,6 +17479,20 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(getClaimRuleOptionsModel.RuleID).To(Equal(core.StringPtr("testString"))) Expect(getClaimRuleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) + It(`Invoke NewGetEffectiveAccountSettingsOptions successfully`, func() { + // Construct an instance of the GetEffectiveAccountSettingsOptions model + accountID := "testString" + getEffectiveAccountSettingsOptionsModel := iamIdentityService.NewGetEffectiveAccountSettingsOptions(accountID) + getEffectiveAccountSettingsOptionsModel.SetAccountID("testString") + getEffectiveAccountSettingsOptionsModel.SetIncludeHistory(false) + getEffectiveAccountSettingsOptionsModel.SetResolveUserMfa(false) + getEffectiveAccountSettingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getEffectiveAccountSettingsOptionsModel).ToNot(BeNil()) + Expect(getEffectiveAccountSettingsOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(getEffectiveAccountSettingsOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(false))) + Expect(getEffectiveAccountSettingsOptionsModel.ResolveUserMfa).To(Equal(core.BoolPtr(false))) + Expect(getEffectiveAccountSettingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) It(`Invoke NewGetLatestAccountSettingsTemplateVersionOptions successfully`, func() { // Construct an instance of the GetLatestAccountSettingsTemplateVersionOptions model templateID := "testString" @@ -17600,6 +18269,40 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(policyTemplateReferenceModel.ID).To(Equal(core.StringPtr("testString"))) Expect(policyTemplateReferenceModel.Version).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the ActionControlsIdentities model + actionControlsIdentitiesModel := new(iamidentityv1.ActionControlsIdentities) + Expect(actionControlsIdentitiesModel).ToNot(BeNil()) + actionControlsIdentitiesModel.Add = core.BoolPtr(true) + actionControlsIdentitiesModel.Remove = core.BoolPtr(true) + Expect(actionControlsIdentitiesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsIdentitiesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControlsRules model + actionControlsRulesModel := new(iamidentityv1.ActionControlsRules) + Expect(actionControlsRulesModel).ToNot(BeNil()) + actionControlsRulesModel.Add = core.BoolPtr(true) + actionControlsRulesModel.Remove = core.BoolPtr(true) + Expect(actionControlsRulesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsRulesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControlsPolicies model + actionControlsPoliciesModel := new(iamidentityv1.ActionControlsPolicies) + Expect(actionControlsPoliciesModel).ToNot(BeNil()) + actionControlsPoliciesModel.Add = core.BoolPtr(true) + actionControlsPoliciesModel.Remove = core.BoolPtr(true) + Expect(actionControlsPoliciesModel.Add).To(Equal(core.BoolPtr(true))) + Expect(actionControlsPoliciesModel.Remove).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ActionControls model + actionControlsModel := new(iamidentityv1.ActionControls) + Expect(actionControlsModel).ToNot(BeNil()) + actionControlsModel.Identities = actionControlsIdentitiesModel + actionControlsModel.Rules = actionControlsRulesModel + actionControlsModel.Policies = actionControlsPoliciesModel + Expect(actionControlsModel.Identities).To(Equal(actionControlsIdentitiesModel)) + Expect(actionControlsModel.Rules).To(Equal(actionControlsRulesModel)) + Expect(actionControlsModel.Policies).To(Equal(actionControlsPoliciesModel)) + // Construct an instance of the UpdateProfileTemplateVersionOptions model ifMatch := "testString" templateID := "testString" @@ -17613,6 +18316,7 @@ var _ = Describe(`IamIdentityV1`, func() { updateProfileTemplateVersionOptionsModel.SetDescription("testString") updateProfileTemplateVersionOptionsModel.SetProfile(templateProfileComponentRequestModel) updateProfileTemplateVersionOptionsModel.SetPolicyTemplateReferences([]iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel}) + updateProfileTemplateVersionOptionsModel.SetActionControls(actionControlsModel) updateProfileTemplateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(updateProfileTemplateVersionOptionsModel).ToNot(BeNil()) Expect(updateProfileTemplateVersionOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) @@ -17623,6 +18327,7 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(updateProfileTemplateVersionOptionsModel.Description).To(Equal(core.StringPtr("testString"))) Expect(updateProfileTemplateVersionOptionsModel.Profile).To(Equal(templateProfileComponentRequestModel)) Expect(updateProfileTemplateVersionOptionsModel.PolicyTemplateReferences).To(Equal([]iamidentityv1.PolicyTemplateReference{*policyTemplateReferenceModel})) + Expect(updateProfileTemplateVersionOptionsModel.ActionControls).To(Equal(actionControlsModel)) Expect(updateProfileTemplateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewUpdateServiceIDOptions successfully`, func() { @@ -17709,6 +18414,83 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(result).ToNot(BeNil()) Expect(result).To(Equal(model)) }) + It(`Invoke UnmarshalActionControls successfully`, func() { + // Construct an instance of the model. + model := new(iamidentityv1.ActionControls) + model.Identities = nil + model.Rules = nil + model.Policies = nil + + b, err := json.Marshal(model) + Expect(err).To(BeNil()) + + var raw map[string]json.RawMessage + err = json.Unmarshal(b, &raw) + Expect(err).To(BeNil()) + + var result *iamidentityv1.ActionControls + err = iamidentityv1.UnmarshalActionControls(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalActionControlsIdentities successfully`, func() { + // Construct an instance of the model. + model := new(iamidentityv1.ActionControlsIdentities) + model.Add = core.BoolPtr(true) + model.Remove = core.BoolPtr(true) + + b, err := json.Marshal(model) + Expect(err).To(BeNil()) + + var raw map[string]json.RawMessage + err = json.Unmarshal(b, &raw) + Expect(err).To(BeNil()) + + var result *iamidentityv1.ActionControlsIdentities + err = iamidentityv1.UnmarshalActionControlsIdentities(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalActionControlsPolicies successfully`, func() { + // Construct an instance of the model. + model := new(iamidentityv1.ActionControlsPolicies) + model.Add = core.BoolPtr(true) + model.Remove = core.BoolPtr(true) + + b, err := json.Marshal(model) + Expect(err).To(BeNil()) + + var raw map[string]json.RawMessage + err = json.Unmarshal(b, &raw) + Expect(err).To(BeNil()) + + var result *iamidentityv1.ActionControlsPolicies + err = iamidentityv1.UnmarshalActionControlsPolicies(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalActionControlsRules successfully`, func() { + // Construct an instance of the model. + model := new(iamidentityv1.ActionControlsRules) + model.Add = core.BoolPtr(true) + model.Remove = core.BoolPtr(true) + + b, err := json.Marshal(model) + Expect(err).To(BeNil()) + + var raw map[string]json.RawMessage + err = json.Unmarshal(b, &raw) + Expect(err).To(BeNil()) + + var result *iamidentityv1.ActionControlsRules + err = iamidentityv1.UnmarshalActionControlsRules(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) It(`Invoke UnmarshalAPIKeyInsideCreateServiceIDRequest successfully`, func() { // Construct an instance of the model. model := new(iamidentityv1.APIKeyInsideCreateServiceIDRequest) @@ -17882,10 +18664,9 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(result).To(Equal(model)) }) }) - Describe(`Utility function tests`, func() { It(`Invoke CreateMockByteArray() successfully`, func() { - mockByteArray := CreateMockByteArray("This is a test") + mockByteArray := CreateMockByteArray("VGhpcyBpcyBhIHRlc3Qgb2YgdGhlIGVtZXJnZW5jeSBicm9hZGNhc3Qgc3lzdGVt") Expect(mockByteArray).ToNot(BeNil()) }) It(`Invoke CreateMockUUID() successfully`, func() { @@ -17911,8 +18692,11 @@ var _ = Describe(`IamIdentityV1`, func() { // Utility functions used by the generated test code // -func CreateMockByteArray(mockData string) *[]byte { - ba := []byte(mockData) +func CreateMockByteArray(encodedString string) *[]byte { + ba, err := base64.StdEncoding.DecodeString(encodedString) + if err != nil { + panic(err) + } return &ba }