From b897eb63576ef6eea9d3896e26ff8bbe1251489a Mon Sep 17 00:00:00 2001 From: Shaun Colley Date: Thu, 30 May 2024 13:25:35 -0400 Subject: [PATCH 1/2] feat(IAM Policy Management): Add Access Management Account Settings API Signed-off-by: Shaun Colley --- .../iam_policy_management_v1.go | 1786 +++++------------ .../iam_policy_management_v1_examples_test.go | 64 +- ...m_policy_management_v1_integration_test.go | 56 +- .../iam_policy_management_v1_test.go | 1403 +++++++------ 4 files changed, 1390 insertions(+), 1919 deletions(-) diff --git a/iampolicymanagementv1/iam_policy_management_v1.go b/iampolicymanagementv1/iam_policy_management_v1.go index dd81016b..75646bba 100644 --- a/iampolicymanagementv1/iam_policy_management_v1.go +++ b/iampolicymanagementv1/iam_policy_management_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.88.0-b0b4c159-20240402-205910 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ // Package iampolicymanagementv1 : Operations and models for the IamPolicyManagementV1 service @@ -63,26 +63,22 @@ func NewIamPolicyManagementV1UsingExternalConfig(options *IamPolicyManagementV1O if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { - err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } iamPolicyManagement, err = NewIamPolicyManagementV1(options) - err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = iamPolicyManagement.Service.ConfigureService(options.ServiceName) if err != nil { - err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = iamPolicyManagement.Service.SetServiceURL(options.URL) - err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -96,14 +92,12 @@ func NewIamPolicyManagementV1(options *IamPolicyManagementV1Options) (service *I baseService, err := core.NewBaseService(serviceOptions) if err != nil { - err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { - err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -117,7 +111,7 @@ func NewIamPolicyManagementV1(options *IamPolicyManagementV1Options) (service *I // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { - return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) + return "", fmt.Errorf("service does not support regional URLs") } // Clone makes a copy of "iamPolicyManagement" suitable for processing requests. @@ -132,11 +126,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) Clone() *IamPolicyManagementV1 // SetServiceURL sets the service URL func (iamPolicyManagement *IamPolicyManagementV1) SetServiceURL(url string) error { - err := iamPolicyManagement.Service.SetServiceURL(url) - if err != nil { - err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) - } - return err + return iamPolicyManagement.Service.SetServiceURL(url) } // GetServiceURL returns the service URL @@ -177,21 +167,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) DisableRetries() { // parameter. Only policies that have the specified attributes and that the caller has read access to are returned. If // the caller does not have read access to any policies an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicies(listPoliciesOptions *ListPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ListPoliciesWithContext(context.Background(), listPoliciesOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ListPoliciesWithContext(context.Background(), listPoliciesOptions) } // ListPoliciesWithContext is an alternate form of the ListPolicies method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx context.Context, listPoliciesOptions *ListPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPoliciesOptions, "listPoliciesOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPoliciesOptions, "listPoliciesOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -200,7 +186,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -248,21 +233,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "list_policies", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyCollection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -316,21 +297,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicy(createPolicyOptions *CreatePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.CreatePolicyWithContext(context.Background(), createPolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CreatePolicyWithContext(context.Background(), createPolicyOptions) } // CreatePolicyWithContext is an alternate form of the CreatePolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx context.Context, createPolicyOptions *CreatePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyOptions, "createPolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyOptions, "createPolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -339,7 +316,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -375,27 +351,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "create_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicy) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -444,21 +415,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicy(replacePolicyOptions *ReplacePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ReplacePolicyWithContext(context.Background(), replacePolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ReplacePolicyWithContext(context.Background(), replacePolicyOptions) } // ReplacePolicyWithContext is an alternate form of the ReplacePolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx context.Context, replacePolicyOptions *ReplacePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replacePolicyOptions, "replacePolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replacePolicyOptions, "replacePolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -471,7 +438,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx c builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -507,27 +473,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx c } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "replace_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicy) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -539,21 +500,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx c // GetPolicy : Retrieve a policy by ID // Retrieve a policy by providing a policy ID. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicy(getPolicyOptions *GetPolicyOptions) (result *PolicyTemplateMetaData, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.GetPolicyWithContext(context.Background(), getPolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.GetPolicyWithContext(context.Background(), getPolicyOptions) } // GetPolicyWithContext is an alternate form of the GetPolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx context.Context, getPolicyOptions *GetPolicyOptions) (result *PolicyTemplateMetaData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyOptions, "getPolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyOptions, "getPolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -566,7 +523,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx conte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -582,21 +538,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx conte request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateMetaData) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -609,21 +561,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx conte // Delete a policy by providing a policy ID. A policy cannot be deleted if the subject ID contains a locked service ID. // If the subject of the policy is a locked service-id, the request will fail. func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicy(deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.DeletePolicyWithContext(context.Background(), deletePolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.DeletePolicyWithContext(context.Background(), deletePolicyOptions) } // DeletePolicyWithContext is an alternate form of the DeletePolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx context.Context, deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyOptions, "deletePolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyOptions, "deletePolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -636,7 +584,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx co builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -651,16 +598,10 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx co request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) - if err != nil { - core.EnrichHTTPProblem(err, "delete_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) - return - } return } @@ -669,21 +610,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx co // Restore a policy that has recently been deleted. A policy administrator might want to restore a deleted policy. To // restore a policy, use **`"state": "active"`** in the body. func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyState(updatePolicyStateOptions *UpdatePolicyStateOptions) (result *Policy, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.UpdatePolicyStateWithContext(context.Background(), updatePolicyStateOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.UpdatePolicyStateWithContext(context.Background(), updatePolicyStateOptions) } // UpdatePolicyStateWithContext is an alternate form of the UpdatePolicyState method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(ctx context.Context, updatePolicyStateOptions *UpdatePolicyStateOptions) (result *Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updatePolicyStateOptions, "updatePolicyStateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updatePolicyStateOptions, "updatePolicyStateOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -696,7 +633,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(c builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -720,27 +656,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(c } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "update_policy_state", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicy) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -756,16 +687,13 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(c // exclusive. Only roles that match the filter and that the caller has read access to are returned. If the caller does // not have read access to any roles an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListRoles(listRolesOptions *ListRolesOptions) (result *RoleCollection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ListRolesWithContext(context.Background(), listRolesOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ListRolesWithContext(context.Background(), listRolesOptions) } // ListRolesWithContext is an alternate form of the ListRoles method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx context.Context, listRolesOptions *ListRolesOptions) (result *RoleCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listRolesOptions, "listRolesOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -774,7 +702,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx conte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -809,21 +736,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx conte request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "list_roles", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleCollection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -838,21 +761,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx conte // service can be mapped to the new role, but there must be at least one service-defined action to successfully create // the new role. func (iamPolicyManagement *IamPolicyManagementV1) CreateRole(createRoleOptions *CreateRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.CreateRoleWithContext(context.Background(), createRoleOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CreateRoleWithContext(context.Background(), createRoleOptions) } // CreateRoleWithContext is an alternate form of the CreateRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx context.Context, createRoleOptions *CreateRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createRoleOptions, "createRoleOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createRoleOptions, "createRoleOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -861,7 +780,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx cont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -900,27 +818,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx cont } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "create_role", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCustomRole) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -933,21 +846,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx cont // Update a custom role. A role administrator might want to update an existing role by updating the display name, // description, or the actions that are mapped to the role. The name, account_id, and service_name can't be changed. func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRole(replaceRoleOptions *ReplaceRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ReplaceRoleWithContext(context.Background(), replaceRoleOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ReplaceRoleWithContext(context.Background(), replaceRoleOptions) } // ReplaceRoleWithContext is an alternate form of the ReplaceRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx context.Context, replaceRoleOptions *ReplaceRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replaceRoleOptions, "replaceRoleOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replaceRoleOptions, "replaceRoleOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -960,7 +869,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx con builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles/{role_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -990,27 +898,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx con } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "replace_role", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCustomRole) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1022,21 +925,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx con // GetRole : Retrieve a role by ID // Retrieve a role by providing a role ID. func (iamPolicyManagement *IamPolicyManagementV1) GetRole(getRoleOptions *GetRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.GetRoleWithContext(context.Background(), getRoleOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.GetRoleWithContext(context.Background(), getRoleOptions) } // GetRoleWithContext is an alternate form of the GetRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context.Context, getRoleOptions *GetRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getRoleOptions, "getRoleOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getRoleOptions, "getRoleOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1049,7 +948,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles/{role_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1065,21 +963,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_role", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCustomRole) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1091,21 +985,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context // DeleteRole : Delete a role by ID // Delete a role by providing a role ID. func (iamPolicyManagement *IamPolicyManagementV1) DeleteRole(deleteRoleOptions *DeleteRoleOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.DeleteRoleWithContext(context.Background(), deleteRoleOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.DeleteRoleWithContext(context.Background(), deleteRoleOptions) } // DeleteRoleWithContext is an alternate form of the DeleteRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx context.Context, deleteRoleOptions *DeleteRoleOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteRoleOptions, "deleteRoleOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteRoleOptions, "deleteRoleOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1118,7 +1008,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx cont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles/{role_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1133,16 +1022,10 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx cont request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) - if err != nil { - core.EnrichHTTPProblem(err, "delete_role", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) - return - } return } @@ -1154,21 +1037,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx cont // parameter. Only policies that have the specified attributes and that the caller has read access to are returned. If // the caller does not have read access to any policies an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListV2Policies(listV2PoliciesOptions *ListV2PoliciesOptions) (result *V2PolicyCollection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ListV2PoliciesWithContext(context.Background(), listV2PoliciesOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ListV2PoliciesWithContext(context.Background(), listV2PoliciesOptions) } // ListV2PoliciesWithContext is an alternate form of the ListV2Policies method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx context.Context, listV2PoliciesOptions *ListV2PoliciesOptions) (result *V2PolicyCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listV2PoliciesOptions, "listV2PoliciesOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listV2PoliciesOptions, "listV2PoliciesOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1177,7 +1056,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1225,21 +1103,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "list_v2_policies", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2PolicyCollection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1367,21 +1241,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) CreateV2Policy(createV2PolicyOptions *CreateV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.CreateV2PolicyWithContext(context.Background(), createV2PolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CreateV2PolicyWithContext(context.Background(), createV2PolicyOptions) } // CreateV2PolicyWithContext is an alternate form of the CreateV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx context.Context, createV2PolicyOptions *CreateV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createV2PolicyOptions, "createV2PolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createV2PolicyOptions, "createV2PolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1390,7 +1260,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1432,27 +1301,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "create_v2_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2Policy) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1578,21 +1442,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2Policy(replaceV2PolicyOptions *ReplaceV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ReplaceV2PolicyWithContext(context.Background(), replaceV2PolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ReplaceV2PolicyWithContext(context.Background(), replaceV2PolicyOptions) } // ReplaceV2PolicyWithContext is an alternate form of the ReplaceV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx context.Context, replaceV2PolicyOptions *ReplaceV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replaceV2PolicyOptions, "replaceV2PolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replaceV2PolicyOptions, "replaceV2PolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1605,7 +1465,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies/{id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1647,27 +1506,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "replace_v2_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2Policy) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1679,21 +1533,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx // GetV2Policy : Retrieve a policy by ID // Retrieve a policy by providing a policy ID. func (iamPolicyManagement *IamPolicyManagementV1) GetV2Policy(getV2PolicyOptions *GetV2PolicyOptions) (result *V2PolicyTemplateMetaData, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.GetV2PolicyWithContext(context.Background(), getV2PolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.GetV2PolicyWithContext(context.Background(), getV2PolicyOptions) } // GetV2PolicyWithContext is an alternate form of the GetV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx context.Context, getV2PolicyOptions *GetV2PolicyOptions) (result *V2PolicyTemplateMetaData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getV2PolicyOptions, "getV2PolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getV2PolicyOptions, "getV2PolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1706,7 +1556,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx con builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies/{id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1726,21 +1575,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx con request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_v2_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2PolicyTemplateMetaData) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1753,21 +1598,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx con // Delete a policy by providing a policy ID. A policy cannot be deleted if the subject ID contains a locked service ID. // If the subject of the policy is a locked service-id, the request will fail. func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2Policy(deleteV2PolicyOptions *DeleteV2PolicyOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.DeleteV2PolicyWithContext(context.Background(), deleteV2PolicyOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.DeleteV2PolicyWithContext(context.Background(), deleteV2PolicyOptions) } // DeleteV2PolicyWithContext is an alternate form of the DeleteV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx context.Context, deleteV2PolicyOptions *DeleteV2PolicyOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteV2PolicyOptions, "deleteV2PolicyOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteV2PolicyOptions, "deleteV2PolicyOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1780,7 +1621,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies/{id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1795,16 +1635,10 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) - if err != nil { - core.EnrichHTTPProblem(err, "delete_v2_policy", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) - return - } return } @@ -1817,21 +1651,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx // the caller has read access to are returned. If the caller does not have read access to any policy templates an empty // array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplates(listPolicyTemplatesOptions *ListPolicyTemplatesOptions) (result *PolicyTemplateCollection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ListPolicyTemplatesWithContext(context.Background(), listPolicyTemplatesOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ListPolicyTemplatesWithContext(context.Background(), listPolicyTemplatesOptions) } // ListPolicyTemplatesWithContext is an alternate form of the ListPolicyTemplates method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext(ctx context.Context, listPolicyTemplatesOptions *ListPolicyTemplatesOptions) (result *PolicyTemplateCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPolicyTemplatesOptions, "listPolicyTemplatesOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPolicyTemplatesOptions, "listPolicyTemplatesOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1840,7 +1670,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1879,21 +1708,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "list_policy_templates", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateCollection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1906,21 +1731,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext // Create a policy template. Policy templates define a policy without requiring a subject, and you can use them to grant // access to multiple subjects. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplate(createPolicyTemplateOptions *CreatePolicyTemplateOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.CreatePolicyTemplateWithContext(context.Background(), createPolicyTemplateOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CreatePolicyTemplateWithContext(context.Background(), createPolicyTemplateOptions) } // CreatePolicyTemplateWithContext is an alternate form of the CreatePolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContext(ctx context.Context, createPolicyTemplateOptions *CreatePolicyTemplateOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyTemplateOptions, "createPolicyTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyTemplateOptions, "createPolicyTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1929,7 +1750,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContex builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1965,27 +1785,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContex } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "create_policy_template", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateLimitData) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1997,21 +1812,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContex // GetPolicyTemplate : Retrieve latest version of a policy template // Retrieve the latest version of a policy template by providing a policy template ID. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplate(getPolicyTemplateOptions *GetPolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.GetPolicyTemplateWithContext(context.Background(), getPolicyTemplateOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.GetPolicyTemplateWithContext(context.Background(), getPolicyTemplateOptions) } // GetPolicyTemplateWithContext is an alternate form of the GetPolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(ctx context.Context, getPolicyTemplateOptions *GetPolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyTemplateOptions, "getPolicyTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyTemplateOptions, "getPolicyTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2024,7 +1835,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(c builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2044,21 +1854,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(c request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_policy_template", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplate) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2072,21 +1878,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(c // template can't be deleted if any version of the template is assigned to one or more child accounts. You must remove // the policy assignments first. func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplate(deletePolicyTemplateOptions *DeletePolicyTemplateOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.DeletePolicyTemplateWithContext(context.Background(), deletePolicyTemplateOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.DeletePolicyTemplateWithContext(context.Background(), deletePolicyTemplateOptions) } // DeletePolicyTemplateWithContext is an alternate form of the DeletePolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContext(ctx context.Context, deletePolicyTemplateOptions *DeletePolicyTemplateOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyTemplateOptions, "deletePolicyTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyTemplateOptions, "deletePolicyTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2099,7 +1901,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContex builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2114,16 +1915,10 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContex request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) - if err != nil { - core.EnrichHTTPProblem(err, "delete_policy_template", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) - return - } return } @@ -2132,21 +1927,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContex // Create a new version of a policy template. Use this if you need to make updates to a policy template that is // committed. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersion(createPolicyTemplateVersionOptions *CreatePolicyTemplateVersionOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.CreatePolicyTemplateVersionWithContext(context.Background(), createPolicyTemplateVersionOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CreatePolicyTemplateVersionWithContext(context.Background(), createPolicyTemplateVersionOptions) } // CreatePolicyTemplateVersionWithContext is an alternate form of the CreatePolicyTemplateVersion method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWithContext(ctx context.Context, createPolicyTemplateVersionOptions *CreatePolicyTemplateVersionOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyTemplateVersionOptions, "createPolicyTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyTemplateVersionOptions, "createPolicyTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2159,7 +1950,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWit builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2189,27 +1979,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWit } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "create_policy_template_version", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateLimitData) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2221,21 +2006,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWit // ListPolicyTemplateVersions : Retrieve policy template versions // Retrieve the versions of a policy template by providing a policy template ID. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersions(listPolicyTemplateVersionsOptions *ListPolicyTemplateVersionsOptions) (result *PolicyTemplateVersionsCollection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ListPolicyTemplateVersionsWithContext(context.Background(), listPolicyTemplateVersionsOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ListPolicyTemplateVersionsWithContext(context.Background(), listPolicyTemplateVersionsOptions) } // ListPolicyTemplateVersionsWithContext is an alternate form of the ListPolicyTemplateVersions method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWithContext(ctx context.Context, listPolicyTemplateVersionsOptions *ListPolicyTemplateVersionsOptions) (result *PolicyTemplateVersionsCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPolicyTemplateVersionsOptions, "listPolicyTemplateVersionsOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPolicyTemplateVersionsOptions, "listPolicyTemplateVersionsOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2248,7 +2029,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWith builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2268,21 +2048,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWith request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "list_policy_template_versions", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateVersionsCollection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2294,21 +2070,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWith // ReplacePolicyTemplate : Update a policy template version // Update a specific version of a policy template. You can use this only if the version isn't committed. func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplate(replacePolicyTemplateOptions *ReplacePolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ReplacePolicyTemplateWithContext(context.Background(), replacePolicyTemplateOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ReplacePolicyTemplateWithContext(context.Background(), replacePolicyTemplateOptions) } // ReplacePolicyTemplateWithContext is an alternate form of the ReplacePolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithContext(ctx context.Context, replacePolicyTemplateOptions *ReplacePolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replacePolicyTemplateOptions, "replacePolicyTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replacePolicyTemplateOptions, "replacePolicyTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2322,7 +2094,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithConte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2355,27 +2126,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithConte } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "replace_policy_template", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplate) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2389,21 +2155,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithConte // a policy template version that is assigned to one or more child accounts. You must remove the policy assignments // first. func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersion(deletePolicyTemplateVersionOptions *DeletePolicyTemplateVersionOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.DeletePolicyTemplateVersionWithContext(context.Background(), deletePolicyTemplateVersionOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.DeletePolicyTemplateVersionWithContext(context.Background(), deletePolicyTemplateVersionOptions) } // DeletePolicyTemplateVersionWithContext is an alternate form of the DeletePolicyTemplateVersion method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWithContext(ctx context.Context, deletePolicyTemplateVersionOptions *DeletePolicyTemplateVersionOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyTemplateVersionOptions, "deletePolicyTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyTemplateVersionOptions, "deletePolicyTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2417,7 +2179,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWit builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2432,16 +2193,10 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWit request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) - if err != nil { - core.EnrichHTTPProblem(err, "delete_policy_template_version", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) - return - } return } @@ -2449,21 +2204,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWit // GetPolicyTemplateVersion : Retrieve a policy template version // Retrieve a policy template by providing a policy template ID and version number. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersion(getPolicyTemplateVersionOptions *GetPolicyTemplateVersionOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.GetPolicyTemplateVersionWithContext(context.Background(), getPolicyTemplateVersionOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.GetPolicyTemplateVersionWithContext(context.Background(), getPolicyTemplateVersionOptions) } // GetPolicyTemplateVersionWithContext is an alternate form of the GetPolicyTemplateVersion method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithContext(ctx context.Context, getPolicyTemplateVersionOptions *GetPolicyTemplateVersionOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyTemplateVersionOptions, "getPolicyTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyTemplateVersionOptions, "getPolicyTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2477,7 +2228,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithCo builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2493,21 +2243,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithCo request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_policy_template_version", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplate) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2520,21 +2266,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithCo // Commit a policy template version. You can make no further changes to the policy template once it's committed. If you // need to make updates after committing a version, create a new version. func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplate(commitPolicyTemplateOptions *CommitPolicyTemplateOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.CommitPolicyTemplateWithContext(context.Background(), commitPolicyTemplateOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CommitPolicyTemplateWithContext(context.Background(), commitPolicyTemplateOptions) } // CommitPolicyTemplateWithContext is an alternate form of the CommitPolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContext(ctx context.Context, commitPolicyTemplateOptions *CommitPolicyTemplateOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(commitPolicyTemplateOptions, "commitPolicyTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(commitPolicyTemplateOptions, "commitPolicyTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2548,7 +2290,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContex builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}/commit`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2563,16 +2304,10 @@ func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContex request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) - if err != nil { - core.EnrichHTTPProblem(err, "commit_policy_template", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) - return - } return } @@ -2584,21 +2319,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContex // that the caller has read access to are returned. If the caller does not have read access to any policy template // assignments an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignments(listPolicyAssignmentsOptions *ListPolicyAssignmentsOptions) (result *PolicyTemplateAssignmentCollection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.ListPolicyAssignmentsWithContext(context.Background(), listPolicyAssignmentsOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.ListPolicyAssignmentsWithContext(context.Background(), listPolicyAssignmentsOptions) } // ListPolicyAssignmentsWithContext is an alternate form of the ListPolicyAssignments method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithContext(ctx context.Context, listPolicyAssignmentsOptions *ListPolicyAssignmentsOptions) (result *PolicyTemplateAssignmentCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPolicyAssignmentsOptions, "listPolicyAssignmentsOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPolicyAssignmentsOptions, "listPolicyAssignmentsOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2607,7 +2338,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithConte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2635,21 +2365,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithConte request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "list_policy_assignments", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateAssignmentCollection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2662,21 +2388,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithConte // Assign a policy template to child accounts and account groups. This creates the policy in the accounts and account // groups that you specify. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment(createPolicyTemplateAssignmentOptions *CreatePolicyTemplateAssignmentOptions) (result *PolicyAssignmentV1Collection, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.CreatePolicyTemplateAssignmentWithContext(context.Background(), createPolicyTemplateAssignmentOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.CreatePolicyTemplateAssignmentWithContext(context.Background(), createPolicyTemplateAssignmentOptions) } // CreatePolicyTemplateAssignmentWithContext is an alternate form of the CreatePolicyTemplateAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignmentWithContext(ctx context.Context, createPolicyTemplateAssignmentOptions *CreatePolicyTemplateAssignmentOptions) (result *PolicyAssignmentV1Collection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyTemplateAssignmentOptions, "createPolicyTemplateAssignmentOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyTemplateAssignmentOptions, "createPolicyTemplateAssignmentOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2685,7 +2407,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments`, nil) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2717,27 +2438,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "create_policy_template_assignment", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyAssignmentV1Collection) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2748,22 +2464,18 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment // GetPolicyAssignment : Retrieve a policy assignment // Retrieve a policy template assignment by providing a policy assignment ID. -func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignment(getPolicyAssignmentOptions *GetPolicyAssignmentOptions) (result GetPolicyAssignmentResponseIntf, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.GetPolicyAssignmentWithContext(context.Background(), getPolicyAssignmentOptions) - err = core.RepurposeSDKProblem(err, "") - return +func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignment(getPolicyAssignmentOptions *GetPolicyAssignmentOptions) (result PolicyTemplateAssignmentItemsIntf, response *core.DetailedResponse, err error) { + return iamPolicyManagement.GetPolicyAssignmentWithContext(context.Background(), getPolicyAssignmentOptions) } // GetPolicyAssignmentWithContext is an alternate form of the GetPolicyAssignment method which supports a Context parameter -func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext(ctx context.Context, getPolicyAssignmentOptions *GetPolicyAssignmentOptions) (result GetPolicyAssignmentResponseIntf, response *core.DetailedResponse, err error) { +func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext(ctx context.Context, getPolicyAssignmentOptions *GetPolicyAssignmentOptions) (result PolicyTemplateAssignmentItemsIntf, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyAssignmentOptions, "getPolicyAssignmentOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyAssignmentOptions, "getPolicyAssignmentOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2776,7 +2488,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments/{assignment_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2794,21 +2505,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_policy_assignment", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalGetPolicyAssignmentResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateAssignmentItems) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2820,21 +2527,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext // UpdatePolicyAssignment : Update a policy authorization type assignment // Update a policy assignment by providing a policy assignment ID. func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignment(updatePolicyAssignmentOptions *UpdatePolicyAssignmentOptions) (result *PolicyAssignmentV1, response *core.DetailedResponse, err error) { - result, response, err = iamPolicyManagement.UpdatePolicyAssignmentWithContext(context.Background(), updatePolicyAssignmentOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.UpdatePolicyAssignmentWithContext(context.Background(), updatePolicyAssignmentOptions) } // UpdatePolicyAssignmentWithContext is an alternate form of the UpdatePolicyAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithContext(ctx context.Context, updatePolicyAssignmentOptions *UpdatePolicyAssignmentOptions) (result *PolicyAssignmentV1, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updatePolicyAssignmentOptions, "updatePolicyAssignmentOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updatePolicyAssignmentOptions, "updatePolicyAssignmentOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2847,7 +2550,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithCont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments/{assignment_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2873,27 +2575,22 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithCont } _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "update_policy_assignment", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyAssignmentV1) if err != nil { - err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2906,21 +2603,17 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithCont // Remove a policy template assignment by providing a policy assignment ID. You can't delete a policy assignment if the // status is "in_progress". func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignment(deletePolicyAssignmentOptions *DeletePolicyAssignmentOptions) (response *core.DetailedResponse, err error) { - response, err = iamPolicyManagement.DeletePolicyAssignmentWithContext(context.Background(), deletePolicyAssignmentOptions) - err = core.RepurposeSDKProblem(err, "") - return + return iamPolicyManagement.DeletePolicyAssignmentWithContext(context.Background(), deletePolicyAssignmentOptions) } // DeletePolicyAssignmentWithContext is an alternate form of the DeletePolicyAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithContext(ctx context.Context, deletePolicyAssignmentOptions *DeletePolicyAssignmentOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyAssignmentOptions, "deletePolicyAssignmentOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyAssignmentOptions, "deletePolicyAssignmentOptions") if err != nil { - err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2933,7 +2626,6 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithCont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments/{assignment_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2948,21 +2640,194 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithCont request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + + return +} + +// GetSettings : Retrieve Access Management account settings by account ID +// Retrieve Access Management settings for an account by providing the account ID. +func (iamPolicyManagement *IamPolicyManagementV1) GetSettings(getSettingsOptions *GetSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { + return iamPolicyManagement.GetSettingsWithContext(context.Background(), getSettingsOptions) +} + +// GetSettingsWithContext is an alternate form of the GetSettings method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetSettingsWithContext(ctx context.Context, getSettingsOptions *GetSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getSettingsOptions, "getSettingsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(getSettingsOptions, "getSettingsOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "account_id": *getSettingsOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/accounts/{account_id}/settings/access_management`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range getSettingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetSettings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if getSettingsOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*getSettingsOptions.AcceptLanguage)) + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettingsAccessManagement) + if err != nil { + return + } + response.Result = result + } + + return +} + +// UpdateSettings : Update Access Management account settings by account ID +// Update access management settings for an account. +// +// ### External Account Identity Interaction +// +// Update the way identities within an external account are allowed to interact with the requested account by providing: +// * the `account_id` as a parameter +// * the external account ID(s) and state for the specific identity in the request body +// +// External account identity interaction includes the following `identity_types`: `user` (user identities defined as +// [IBMid’s](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#users-bestpract)), `service_id` +// (defined as [IAM +// ServiceIds](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#serviceid-bestpract)), `service` +// (defined by a service’s [CRN](https://test.cloud.ibm.com/docs/account?topic=account-crn)). To update an Identity’s +// setting, the `state` and `external_allowed_accounts` fields are required. +// +// Different identity states are: +// "enabled": An identity type is allowed to access resources in the account provided it has access policies on those +// resources. +// "limited": An identity type is allowed to access resources in the account provided it has access policies on those +// resources AND it is associated with either the account the resources are in or one of the allowed accounts. This +// setting leverages the "external_allowed_accounts" list. +// "monitor": Has no direct impact on an Identity’s access. Instead, it creates AT events for access decisions as if the +// account were in a limited “state”. +// +// **Note**: The state "enabled" is a special case. In this case, access is given to all accounts and there is no need +// to specify a particular list. Therefore, when updating "state" to "enabled" for an identity type +// "external_allowed_accounts" should be left empty. +func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettings(updateSettingsOptions *UpdateSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { + return iamPolicyManagement.UpdateSettingsWithContext(context.Background(), updateSettingsOptions) +} + +// UpdateSettingsWithContext is an alternate form of the UpdateSettings method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettingsWithContext(ctx context.Context, updateSettingsOptions *UpdateSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateSettingsOptions, "updateSettingsOptions cannot be nil") + if err != nil { + return + } + err = core.ValidateStruct(updateSettingsOptions, "updateSettingsOptions") + if err != nil { + return + } + + pathParamsMap := map[string]string{ + "account_id": *updateSettingsOptions.AccountID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/accounts/{account_id}/settings/access_management`, pathParamsMap) + if err != nil { + return + } + + for headerName, headerValue := range updateSettingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "UpdateSettings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if updateSettingsOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateSettingsOptions.IfMatch)) + } + if updateSettingsOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*updateSettingsOptions.AcceptLanguage)) + } + + body := make(map[string]interface{}) + if updateSettingsOptions.ExternalAccountIdentityInteraction != nil { + body["external_account_identity_interaction"] = updateSettingsOptions.ExternalAccountIdentityInteraction + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + return + } + + request, err := builder.Build() + if err != nil { + return + } + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "delete_policy_assignment", getServiceComponentInfo()) - err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettingsAccessManagement) + if err != nil { + return + } + response.Result = result + } return } -func getServiceComponentInfo() *core.ProblemComponent { - return core.NewProblemComponent(DefaultServiceName, "1.0.1") + +// AccountSettingsAccessManagement : The Access Management Account Settings that are currently set for the requested account. +type AccountSettingsAccessManagement struct { + // How external accounts can interact in relation to the requested account. + ExternalAccountIdentityInteraction *ExternalAccountIdentityInteraction `json:"external_account_identity_interaction" validate:"required"` +} + +// UnmarshalAccountSettingsAccessManagement unmarshals an instance of AccountSettingsAccessManagement from the specified map of raw messages. +func UnmarshalAccountSettingsAccessManagement(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsAccessManagement) + err = core.UnmarshalModel(m, "external_account_identity_interaction", &obj.ExternalAccountIdentityInteraction, UnmarshalExternalAccountIdentityInteraction) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } // AssignmentResourceCreated : On success, includes the policy assigned. @@ -2976,7 +2841,6 @@ func UnmarshalAssignmentResourceCreated(m map[string]json.RawMessage, result int obj := new(AssignmentResourceCreated) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3003,12 +2867,10 @@ func UnmarshalAssignmentTargetDetails(m map[string]json.RawMessage, result inter obj := new(AssignmentTargetDetails) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3029,12 +2891,10 @@ func UnmarshalAssignmentTemplateDetails(m map[string]json.RawMessage, result int obj := new(AssignmentTemplateDetails) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3096,17 +2956,14 @@ func UnmarshalConflictsWith(m map[string]json.RawMessage, result interface{}) (e obj := new(ConflictsWith) err = core.UnmarshalPrimitive(m, "etag", &obj.Etag) if err != nil { - err = core.SDKErrorf(err, "", "etag-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "role", &obj.Role) if err != nil { - err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3125,9 +2982,6 @@ func (*IamPolicyManagementV1) NewControl(grant *Grant) (_model *Control, err err Grant: grant, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -3136,7 +2990,6 @@ func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err err obj := new(Control) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3164,7 +3017,6 @@ func UnmarshalControlResponse(m map[string]json.RawMessage, result interface{}) obj := new(ControlResponse) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3749,67 +3601,54 @@ func UnmarshalCustomRole(m map[string]json.RawMessage, result interface{}) (err obj := new(CustomRole) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { - err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) if err != nil { - err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { - err = core.SDKErrorf(err, "", "crn-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, "account_id", &obj.AccountID) if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "service_name", &obj.ServiceName) if err != nil { - err = core.SDKErrorf(err, "", "service_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4016,22 +3855,18 @@ func UnmarshalEnrichedRoles(m map[string]json.RawMessage, result interface{}) (e obj := new(EnrichedRoles) err = core.UnmarshalPrimitive(m, "role_id", &obj.RoleID) if err != nil { - err = core.SDKErrorf(err, "", "role_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { - err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalRoleAction) if err != nil { - err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4049,7 +3884,6 @@ func UnmarshalErrorDetails(m map[string]json.RawMessage, result interface{}) (er obj := new(ErrorDetails) err = core.UnmarshalModel(m, "conflicts_with", &obj.ConflictsWith, UnmarshalConflictsWith) if err != nil { - err = core.SDKErrorf(err, "", "conflicts_with-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4086,6 +3920,7 @@ const ( ErrorObjectCodePolicyTemplateConflictErrorConst = "policy_template_conflict_error" ErrorObjectCodePolicyTemplateNotFoundConst = "policy_template_not_found" ErrorObjectCodeRequestNotProcessedConst = "request_not_processed" + ErrorObjectCodeResourceNotFoundConst = "resource_not_found" ErrorObjectCodeRoleConflictErrorConst = "role_conflict_error" ErrorObjectCodeRoleNotFoundConst = "role_not_found" ErrorObjectCodeTooManyRequestsConst = "too_many_requests" @@ -4098,22 +3933,18 @@ func UnmarshalErrorObject(m map[string]json.RawMessage, result interface{}) (err obj := new(ErrorObject) err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { - err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { - err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "details", &obj.Details, UnmarshalErrorDetails) if err != nil { - err = core.SDKErrorf(err, "", "details-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { - err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4137,17 +3968,48 @@ func UnmarshalErrorResponse(m map[string]json.RawMessage, result interface{}) (e obj := new(ErrorResponse) err = core.UnmarshalPrimitive(m, "trace", &obj.Trace) if err != nil { - err = core.SDKErrorf(err, "", "trace-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalErrorObject) if err != nil { - err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status_code", &obj.StatusCode) if err != nil { - err = core.SDKErrorf(err, "", "status_code-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ExternalAccountIdentityInteraction : How external accounts can interact in relation to the requested account. +type ExternalAccountIdentityInteraction struct { + // The settings for each identity type. + IdentityTypes *IdentityTypes `json:"identity_types" validate:"required"` +} + +// UnmarshalExternalAccountIdentityInteraction unmarshals an instance of ExternalAccountIdentityInteraction from the specified map of raw messages. +func UnmarshalExternalAccountIdentityInteraction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ExternalAccountIdentityInteraction) + err = core.UnmarshalModel(m, "identity_types", &obj.IdentityTypes, UnmarshalIdentityTypes) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ExternalAccountIdentityInteractionPatch : Update to how external accounts can interact in relation to the requested account. +type ExternalAccountIdentityInteractionPatch struct { + // The settings to apply for each identity type for a request. + IdentityTypes *IdentityTypesPatch `json:"identity_types,omitempty"` +} + +// UnmarshalExternalAccountIdentityInteractionPatch unmarshals an instance of ExternalAccountIdentityInteractionPatch from the specified map of raw messages. +func UnmarshalExternalAccountIdentityInteractionPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ExternalAccountIdentityInteractionPatch) + err = core.UnmarshalModel(m, "identity_types", &obj.IdentityTypes, UnmarshalIdentityTypesPatch) + if err != nil { return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4192,290 +4054,59 @@ func (options *GetPolicyAssignmentOptions) SetHeaders(param map[string]string) * return options } -// GetPolicyAssignmentResponse : GetPolicyAssignmentResponse struct -// Models which "extend" this model: -// - GetPolicyAssignmentResponsePolicyAssignmentV1 -// - GetPolicyAssignmentResponsePolicyAssignment -type GetPolicyAssignmentResponse struct { - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target,omitempty"` - - // The set of properties required for a policy assignment. - Options *PolicyAssignmentV1Options `json:"options,omitempty"` - - // Policy assignment ID. - ID *string `json:"id,omitempty"` +// GetPolicyOptions : The GetPolicy options. +type GetPolicyOptions struct { + // The policy ID. + PolicyID *string `json:"policy_id" validate:"required,ne="` - // The account GUID that the policies assignments belong to.. - AccountID *string `json:"account_id,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // The href URL that links to the policies assignments API by policy assignment ID. - Href *string `json:"href,omitempty"` +// NewGetPolicyOptions : Instantiate GetPolicyOptions +func (*IamPolicyManagementV1) NewGetPolicyOptions(policyID string) *GetPolicyOptions { + return &GetPolicyOptions{ + PolicyID: core.StringPtr(policyID), + } +} - // The UTC timestamp when the policy assignment was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` +// SetPolicyID : Allow user to set PolicyID +func (_options *GetPolicyOptions) SetPolicyID(policyID string) *GetPolicyOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} - // The iam ID of the entity that created the policy assignment. - CreatedByID *string `json:"created_by_id,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *GetPolicyOptions) SetHeaders(param map[string]string) *GetPolicyOptions { + options.Headers = param + return options +} - // The UTC timestamp when the policy assignment was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` +// GetPolicyTemplateOptions : The GetPolicyTemplate options. +type GetPolicyTemplateOptions struct { + // The policy template ID. + PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` - // The iam ID of the entity that last modified the policy assignment. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + // The policy template state. + State *string `json:"state,omitempty"` - // Object for each account assigned. - Resources []PolicyAssignmentV1Resources `json:"resources,omitempty"` + // Allows users to set headers on API requests + Headers map[string]string +} - // subject details of access type assignment. - Subject *GetPolicyAssignmentResponseSubject `json:"subject,omitempty"` +// Constants associated with the GetPolicyTemplateOptions.State property. +// The policy template state. +const ( + GetPolicyTemplateOptionsStateActiveConst = "active" + GetPolicyTemplateOptionsStateDeletedConst = "deleted" +) - // policy template details. - Template *AssignmentTemplateDetails `json:"template,omitempty"` - - // The policy assignment status. - Status *string `json:"status,omitempty"` - - // policy template id. - TemplateID *string `json:"template_id,omitempty"` - - // policy template version. - TemplateVersion *string `json:"template_version,omitempty"` - - // Passed in value to correlate with other assignments. - AssignmentID *string `json:"assignment_id,omitempty"` - - // Assignment target type. - TargetType *string `json:"target_type,omitempty"` -} - -// Constants associated with the GetPolicyAssignmentResponse.Status property. -// The policy assignment status. -const ( - GetPolicyAssignmentResponseStatusFailedConst = "failed" - GetPolicyAssignmentResponseStatusInProgressConst = "in_progress" - GetPolicyAssignmentResponseStatusSucceedWithErrorsConst = "succeed_with_errors" - GetPolicyAssignmentResponseStatusSucceededConst = "succeeded" -) - -// Constants associated with the GetPolicyAssignmentResponse.TargetType property. -// Assignment target type. -const ( - GetPolicyAssignmentResponseTargetTypeAccountConst = "Account" -) -func (*GetPolicyAssignmentResponse) isaGetPolicyAssignmentResponse() bool { - return true -} - -type GetPolicyAssignmentResponseIntf interface { - isaGetPolicyAssignmentResponse() bool -} - -// UnmarshalGetPolicyAssignmentResponse unmarshals an instance of GetPolicyAssignmentResponse from the specified map of raw messages. -func UnmarshalGetPolicyAssignmentResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetPolicyAssignmentResponse) - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) - if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) - if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalGetPolicyAssignmentResponseSubject) - if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) - if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) - return - } - 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, "assignment_id", &obj.AssignmentID) - if err != nil { - err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "target_type", &obj.TargetType) - if err != nil { - err = core.SDKErrorf(err, "", "target_type-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetPolicyAssignmentResponsePolicyAssignmentV1Subject : subject details of access type assignment. -type GetPolicyAssignmentResponsePolicyAssignmentV1Subject struct { - ID *string `json:"id,omitempty"` - - Type *string `json:"type,omitempty"` -} - -// Constants associated with the GetPolicyAssignmentResponsePolicyAssignmentV1Subject.Type property. -const ( - GetPolicyAssignmentResponsePolicyAssignmentV1SubjectTypeAccessGroupIDConst = "access_group_id" - GetPolicyAssignmentResponsePolicyAssignmentV1SubjectTypeIamIDConst = "iam_id" -) - -// UnmarshalGetPolicyAssignmentResponsePolicyAssignmentV1Subject unmarshals an instance of GetPolicyAssignmentResponsePolicyAssignmentV1Subject from the specified map of raw messages. -func UnmarshalGetPolicyAssignmentResponsePolicyAssignmentV1Subject(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetPolicyAssignmentResponsePolicyAssignmentV1Subject) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetPolicyAssignmentResponseSubject : subject details of access type assignment. -type GetPolicyAssignmentResponseSubject struct { - ID *string `json:"id,omitempty"` - - Type *string `json:"type,omitempty"` -} - -// Constants associated with the GetPolicyAssignmentResponseSubject.Type property. -const ( - GetPolicyAssignmentResponseSubjectTypeAccessGroupIDConst = "access_group_id" - GetPolicyAssignmentResponseSubjectTypeIamIDConst = "iam_id" -) - -// UnmarshalGetPolicyAssignmentResponseSubject unmarshals an instance of GetPolicyAssignmentResponseSubject from the specified map of raw messages. -func UnmarshalGetPolicyAssignmentResponseSubject(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetPolicyAssignmentResponseSubject) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetPolicyOptions : The GetPolicy options. -type GetPolicyOptions struct { - // The policy ID. - PolicyID *string `json:"policy_id" validate:"required,ne="` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetPolicyOptions : Instantiate GetPolicyOptions -func (*IamPolicyManagementV1) NewGetPolicyOptions(policyID string) *GetPolicyOptions { - return &GetPolicyOptions{ - PolicyID: core.StringPtr(policyID), - } -} - -// SetPolicyID : Allow user to set PolicyID -func (_options *GetPolicyOptions) SetPolicyID(policyID string) *GetPolicyOptions { - _options.PolicyID = core.StringPtr(policyID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetPolicyOptions) SetHeaders(param map[string]string) *GetPolicyOptions { - options.Headers = param - return options -} - -// GetPolicyTemplateOptions : The GetPolicyTemplate options. -type GetPolicyTemplateOptions struct { - // The policy template ID. - PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` - - // The policy template state. - State *string `json:"state,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// Constants associated with the GetPolicyTemplateOptions.State property. -// The policy template state. -const ( - GetPolicyTemplateOptionsStateActiveConst = "active" - GetPolicyTemplateOptionsStateDeletedConst = "deleted" -) - -// NewGetPolicyTemplateOptions : Instantiate GetPolicyTemplateOptions -func (*IamPolicyManagementV1) NewGetPolicyTemplateOptions(policyTemplateID string) *GetPolicyTemplateOptions { - return &GetPolicyTemplateOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - } -} +// NewGetPolicyTemplateOptions : Instantiate GetPolicyTemplateOptions +func (*IamPolicyManagementV1) NewGetPolicyTemplateOptions(policyTemplateID string) *GetPolicyTemplateOptions { + return &GetPolicyTemplateOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + } +} // SetPolicyTemplateID : Allow user to set PolicyTemplateID func (_options *GetPolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *GetPolicyTemplateOptions { @@ -4561,6 +4192,54 @@ func (options *GetRoleOptions) SetHeaders(param map[string]string) *GetRoleOptio return options } +// GetSettingsOptions : The GetSettings options. +type GetSettingsOptions struct { + // The account GUID that the settings belong to. + AccountID *string `json:"account_id" validate:"required,ne="` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewGetSettingsOptions : Instantiate GetSettingsOptions +func (*IamPolicyManagementV1) NewGetSettingsOptions(accountID string) *GetSettingsOptions { + return &GetSettingsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *GetSettingsOptions) SetAccountID(accountID string) *GetSettingsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *GetSettingsOptions) SetAcceptLanguage(acceptLanguage string) *GetSettingsOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetSettingsOptions) SetHeaders(param map[string]string) *GetSettingsOptions { + options.Headers = param + return options +} + // GetV2PolicyOptions : The GetV2Policy options. type GetV2PolicyOptions struct { // The policy ID. @@ -4625,9 +4304,6 @@ func (*IamPolicyManagementV1) NewGrant(roles []Roles) (_model *Grant, err error) Roles: roles, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -4636,7 +4312,6 @@ func UnmarshalGrant(m map[string]json.RawMessage, result interface{}) (err error obj := new(Grant) err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalRoles) if err != nil { - err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4654,7 +4329,110 @@ func UnmarshalGrantWithEnrichedRoles(m map[string]json.RawMessage, result interf obj := new(GrantWithEnrichedRoles) err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalEnrichedRoles) if err != nil { - err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityTypes : The settings for each identity type. +type IdentityTypes struct { + // The core set of properties associated with an identity type. + User *IdentityTypesBase `json:"user" validate:"required"` + + // The core set of properties associated with an identity type. + ServiceID *IdentityTypesBase `json:"service_id" validate:"required"` + + // The core set of properties associated with an identity type. + Service *IdentityTypesBase `json:"service" validate:"required"` +} + +// UnmarshalIdentityTypes unmarshals an instance of IdentityTypes from the specified map of raw messages. +func UnmarshalIdentityTypes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityTypes) + err = core.UnmarshalModel(m, "user", &obj.User, UnmarshalIdentityTypesBase) + if err != nil { + return + } + err = core.UnmarshalModel(m, "service_id", &obj.ServiceID, UnmarshalIdentityTypesBase) + if err != nil { + return + } + err = core.UnmarshalModel(m, "service", &obj.Service, UnmarshalIdentityTypesBase) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityTypesBase : The core set of properties associated with an identity type. +type IdentityTypesBase struct { + // The state of the identity type. + State *string `json:"state" validate:"required"` + + // List of accounts that the state applies to for a given identity. + ExternalAllowedAccounts []string `json:"external_allowed_accounts" validate:"required"` +} + +// Constants associated with the IdentityTypesBase.State property. +// The state of the identity type. +const ( + IdentityTypesBaseStateEnabledConst = "enabled" + IdentityTypesBaseStateLimitedConst = "limited" + IdentityTypesBaseStateMonitorConst = "monitor" +) + +// NewIdentityTypesBase : Instantiate IdentityTypesBase (Generic Model Constructor) +func (*IamPolicyManagementV1) NewIdentityTypesBase(state string, externalAllowedAccounts []string) (_model *IdentityTypesBase, err error) { + _model = &IdentityTypesBase{ + State: core.StringPtr(state), + ExternalAllowedAccounts: externalAllowedAccounts, + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalIdentityTypesBase unmarshals an instance of IdentityTypesBase from the specified map of raw messages. +func UnmarshalIdentityTypesBase(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityTypesBase) + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "external_allowed_accounts", &obj.ExternalAllowedAccounts) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// IdentityTypesPatch : The settings to apply for each identity type for a request. +type IdentityTypesPatch struct { + // The core set of properties associated with an identity type. + User *IdentityTypesBase `json:"user,omitempty"` + + // The core set of properties associated with an identity type. + ServiceID *IdentityTypesBase `json:"service_id,omitempty"` + + // The core set of properties associated with an identity type. + Service *IdentityTypesBase `json:"service,omitempty"` +} + +// UnmarshalIdentityTypesPatch unmarshals an instance of IdentityTypesPatch from the specified map of raw messages. +func UnmarshalIdentityTypesPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(IdentityTypesPatch) + err = core.UnmarshalModel(m, "user", &obj.User, UnmarshalIdentityTypesBase) + if err != nil { + return + } + err = core.UnmarshalModel(m, "service_id", &obj.ServiceID, UnmarshalIdentityTypesBase) + if err != nil { + return + } + err = core.UnmarshalModel(m, "service", &obj.Service, UnmarshalIdentityTypesBase) + if err != nil { return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4675,12 +4453,10 @@ func UnmarshalLimitData(m map[string]json.RawMessage, result interface{}) (err e obj := new(LimitData) err = core.UnmarshalPrimitive(m, "current", &obj.Current) if err != nil { - err = core.SDKErrorf(err, "", "current-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5432,22 +5208,18 @@ func UnmarshalNestedCondition(m map[string]json.RawMessage, result interface{}) obj := new(NestedCondition) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalRuleAttribute) if err != nil { - err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5505,62 +5277,50 @@ func UnmarshalPolicy(m map[string]json.RawMessage, result interface{}) (err erro obj := new(Policy) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) if err != nil { - err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) if err != nil { - err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5597,27 +5357,22 @@ func UnmarshalPolicyAssignmentOptions(m map[string]json.RawMessage, result inter obj := new(PolicyAssignmentOptions) err = core.UnmarshalPrimitive(m, "subject_type", &obj.SubjectType) if err != nil { - err = core.SDKErrorf(err, "", "subject_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "subject_id", &obj.SubjectID) if err != nil { - err = core.SDKErrorf(err, "", "subject_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_requester_id", &obj.RootRequesterID) if err != nil { - err = core.SDKErrorf(err, "", "root_requester_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_template_id", &obj.RootTemplateID) if err != nil { - err = core.SDKErrorf(err, "", "root_template_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_template_version", &obj.RootTemplateVersion) if err != nil { - err = core.SDKErrorf(err, "", "root_template_version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5641,17 +5396,14 @@ func UnmarshalPolicyAssignmentResourcePolicy(m map[string]json.RawMessage, resul obj := new(PolicyAssignmentResourcePolicy) err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalAssignmentResourceCreated) if err != nil { - err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalErrorResponse) if err != nil { - err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5672,12 +5424,10 @@ func UnmarshalPolicyAssignmentResources(m map[string]json.RawMessage, result int obj := new(PolicyAssignmentResources) err = core.UnmarshalPrimitive(m, "target", &obj.Target) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalPolicyAssignmentResourcePolicy) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5740,67 +5490,54 @@ func UnmarshalPolicyAssignmentV1(m map[string]json.RawMessage, result interface{ obj := new(PolicyAssignmentV1) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5818,7 +5555,6 @@ func UnmarshalPolicyAssignmentV1Collection(m map[string]json.RawMessage, result obj := new(PolicyAssignmentV1Collection) err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalPolicyAssignmentV1) if err != nil { - err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5827,6 +5563,7 @@ func UnmarshalPolicyAssignmentV1Collection(m map[string]json.RawMessage, result // PolicyAssignmentV1Options : The set of properties required for a policy assignment. type PolicyAssignmentV1Options struct { + // The set of properties where the assignment is being built from. Root *PolicyAssignmentV1OptionsRoot `json:"root" validate:"required"` } @@ -5836,9 +5573,6 @@ func (*IamPolicyManagementV1) NewPolicyAssignmentV1Options(root *PolicyAssignmen Root: root, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -5847,20 +5581,21 @@ func UnmarshalPolicyAssignmentV1Options(m map[string]json.RawMessage, result int obj := new(PolicyAssignmentV1Options) err = core.UnmarshalModel(m, "root", &obj.Root, UnmarshalPolicyAssignmentV1OptionsRoot) if err != nil { - err = core.SDKErrorf(err, "", "root-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// PolicyAssignmentV1OptionsRoot : PolicyAssignmentV1OptionsRoot struct +// PolicyAssignmentV1OptionsRoot : The set of properties where the assignment is being built from. type PolicyAssignmentV1OptionsRoot struct { + // The policy assignment requester id. RequesterID *string `json:"requester_id,omitempty"` // Passed in value to correlate with other assignments. AssignmentID *string `json:"assignment_id,omitempty"` + // The template where the assignment is being built from. Template *PolicyAssignmentV1OptionsRootTemplate `json:"template,omitempty"` } @@ -5869,24 +5604,21 @@ func UnmarshalPolicyAssignmentV1OptionsRoot(m map[string]json.RawMessage, result obj := new(PolicyAssignmentV1OptionsRoot) err = core.UnmarshalPrimitive(m, "requester_id", &obj.RequesterID) if err != nil { - err = core.SDKErrorf(err, "", "requester_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "assignment_id", &obj.AssignmentID) if err != nil { - err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalPolicyAssignmentV1OptionsRootTemplate) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// PolicyAssignmentV1OptionsRootTemplate : PolicyAssignmentV1OptionsRootTemplate struct +// PolicyAssignmentV1OptionsRootTemplate : The template where the assignment is being built from. type PolicyAssignmentV1OptionsRootTemplate struct { // The template id where this policy is being assigned from. ID *string `json:"id,omitempty"` @@ -5900,12 +5632,10 @@ func UnmarshalPolicyAssignmentV1OptionsRootTemplate(m map[string]json.RawMessage obj := new(PolicyAssignmentV1OptionsRootTemplate) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5926,12 +5656,10 @@ func UnmarshalPolicyAssignmentV1Resources(m map[string]json.RawMessage, result i obj := new(PolicyAssignmentV1Resources) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalPolicyAssignmentResourcePolicy) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5940,12 +5668,15 @@ func UnmarshalPolicyAssignmentV1Resources(m map[string]json.RawMessage, result i // PolicyAssignmentV1Subject : subject details of access type assignment. type PolicyAssignmentV1Subject struct { + // The unique identifier of the subject of the assignment. ID *string `json:"id,omitempty"` + // The identity type of the subject of the assignment. Type *string `json:"type,omitempty"` } // Constants associated with the PolicyAssignmentV1Subject.Type property. +// The identity type of the subject of the assignment. const ( PolicyAssignmentV1SubjectTypeAccessGroupIDConst = "access_group_id" PolicyAssignmentV1SubjectTypeIamIDConst = "iam_id" @@ -5956,12 +5687,10 @@ func UnmarshalPolicyAssignmentV1Subject(m map[string]json.RawMessage, result int obj := new(PolicyAssignmentV1Subject) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5979,7 +5708,6 @@ func UnmarshalPolicyCollection(m map[string]json.RawMessage, result interface{}) obj := new(PolicyCollection) err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalPolicyTemplateMetaData) if err != nil { - err = core.SDKErrorf(err, "", "policies-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6000,12 +5728,10 @@ func UnmarshalPolicyResource(m map[string]json.RawMessage, result interface{}) ( obj := new(PolicyResource) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalResourceAttribute) if err != nil { - err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tags", &obj.Tags, UnmarshalResourceTag) if err != nil { - err = core.SDKErrorf(err, "", "tags-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6030,9 +5756,6 @@ func (*IamPolicyManagementV1) NewPolicyRole(roleID string) (_model *PolicyRole, RoleID: core.StringPtr(roleID), } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -6041,17 +5764,14 @@ func UnmarshalPolicyRole(m map[string]json.RawMessage, result interface{}) (err obj := new(PolicyRole) err = core.UnmarshalPrimitive(m, "role_id", &obj.RoleID) if err != nil { - err = core.SDKErrorf(err, "", "role_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { - err = core.SDKErrorf(err, "", "display_name-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)) @@ -6069,7 +5789,6 @@ func UnmarshalPolicySubject(m map[string]json.RawMessage, result interface{}) (e obj := new(PolicySubject) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalSubjectAttribute) if err != nil { - err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6132,67 +5851,54 @@ func UnmarshalPolicyTemplate(m map[string]json.RawMessage, result interface{}) ( obj := new(PolicyTemplate) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-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.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) if err != nil { - err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalTemplatePolicy) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6210,7 +5916,6 @@ func UnmarshalPolicyTemplateAssignmentCollection(m map[string]json.RawMessage, r obj := new(PolicyTemplateAssignmentCollection) err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalPolicyTemplateAssignmentItems) if err != nil { - err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6301,87 +6006,70 @@ func UnmarshalPolicyTemplateAssignmentItems(m map[string]json.RawMessage, result obj := new(PolicyTemplateAssignmentItems) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } 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, "assignment_id", &obj.AssignmentID) if err != nil { - err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "target_type", &obj.TargetType) if err != nil { - err = core.SDKErrorf(err, "", "target_type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6399,7 +6087,6 @@ func UnmarshalPolicyTemplateCollection(m map[string]json.RawMessage, result inte obj := new(PolicyTemplateCollection) err = core.UnmarshalModel(m, "policy_templates", &obj.PolicyTemplates, UnmarshalPolicyTemplate) if err != nil { - err = core.SDKErrorf(err, "", "policy_templates-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6465,72 +6152,58 @@ func UnmarshalPolicyTemplateLimitData(m map[string]json.RawMessage, result inter obj := new(PolicyTemplateLimitData) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-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.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) if err != nil { - err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalTemplatePolicy) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "counts", &obj.Counts, UnmarshalTemplateCountData) if err != nil { - err = core.SDKErrorf(err, "", "counts-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6592,67 +6265,54 @@ func UnmarshalPolicyTemplateMetaData(m map[string]json.RawMessage, result interf obj := new(PolicyTemplateMetaData) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) if err != nil { - err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) if err != nil { - err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6670,7 +6330,6 @@ func UnmarshalPolicyTemplateVersionsCollection(m map[string]json.RawMessage, res obj := new(PolicyTemplateVersionsCollection) err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalPolicyTemplate) if err != nil { - err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7054,9 +6713,6 @@ func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_ Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7065,17 +6721,14 @@ func UnmarshalResourceAttribute(m map[string]json.RawMessage, result interface{} obj := new(ResourceAttribute) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7101,9 +6754,6 @@ func (*IamPolicyManagementV1) NewResourceTag(name string, value string) (_model Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7112,17 +6762,14 @@ func UnmarshalResourceTag(m map[string]json.RawMessage, result interface{}) (err obj := new(ResourceTag) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7153,9 +6800,6 @@ func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_mo Actions: actions, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7164,22 +6808,18 @@ func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) obj := new(Role) err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { - err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) if err != nil { - err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7203,17 +6843,14 @@ func UnmarshalRoleAction(m map[string]json.RawMessage, result interface{}) (err obj := new(RoleAction) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { - err = core.SDKErrorf(err, "", "display_name-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)) @@ -7237,17 +6874,14 @@ func UnmarshalRoleCollection(m map[string]json.RawMessage, result interface{}) ( obj := new(RoleCollection) err = core.UnmarshalModel(m, "custom_roles", &obj.CustomRoles, UnmarshalCustomRole) if err != nil { - err = core.SDKErrorf(err, "", "custom_roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "service_roles", &obj.ServiceRoles, UnmarshalRole) if err != nil { - err = core.SDKErrorf(err, "", "service_roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "system_roles", &obj.SystemRoles, UnmarshalRole) if err != nil { - err = core.SDKErrorf(err, "", "system_roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7266,9 +6900,6 @@ func (*IamPolicyManagementV1) NewRoles(roleID string) (_model *Roles, err error) RoleID: core.StringPtr(roleID), } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7277,7 +6908,6 @@ func UnmarshalRoles(m map[string]json.RawMessage, result interface{}) (err error obj := new(Roles) err = core.UnmarshalPrimitive(m, "role_id", &obj.RoleID) if err != nil { - err = core.SDKErrorf(err, "", "role_id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7329,9 +6959,6 @@ func (*IamPolicyManagementV1) NewRuleAttribute(key string, operator string, valu Value: value, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7340,17 +6967,14 @@ func UnmarshalRuleAttribute(m map[string]json.RawMessage, result interface{}) (e obj := new(RuleAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7373,9 +6997,6 @@ func (*IamPolicyManagementV1) NewSubjectAttribute(name string, value string) (_m Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7384,12 +7005,10 @@ func UnmarshalSubjectAttribute(m map[string]json.RawMessage, result interface{}) obj := new(SubjectAttribute) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7410,12 +7029,10 @@ func UnmarshalTemplateCountData(m map[string]json.RawMessage, result interface{} obj := new(TemplateCountData) err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalLimitData) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalLimitData) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7446,27 +7063,22 @@ func UnmarshalTemplateMetadata(m map[string]json.RawMessage, result interface{}) obj := new(TemplateMetadata) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "assignment_id", &obj.AssignmentID) if err != nil { - err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_id", &obj.RootID) if err != nil { - err = core.SDKErrorf(err, "", "root_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_version", &obj.RootVersion) if err != nil { - err = core.SDKErrorf(err, "", "root_version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7514,9 +7126,6 @@ func (*IamPolicyManagementV1) NewTemplatePolicy(typeVar string, resource *V2Poli Control: control, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7525,37 +7134,30 @@ func UnmarshalTemplatePolicy(m map[string]json.RawMessage, result interface{}) ( obj := new(TemplatePolicy) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource", &obj.Resource, UnmarshalV2PolicyResource) if err != nil { - err = core.SDKErrorf(err, "", "resource-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalV2PolicySubject) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "pattern", &obj.Pattern) if err != nil { - err = core.SDKErrorf(err, "", "pattern-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "rule", &obj.Rule, UnmarshalV2PolicyRule) if err != nil { - err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControl) if err != nil { - err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7653,26 +7255,95 @@ func (*IamPolicyManagementV1) NewUpdatePolicyStateOptions(policyID string, ifMat } } -// SetPolicyID : Allow user to set PolicyID -func (_options *UpdatePolicyStateOptions) SetPolicyID(policyID string) *UpdatePolicyStateOptions { - _options.PolicyID = core.StringPtr(policyID) +// SetPolicyID : Allow user to set PolicyID +func (_options *UpdatePolicyStateOptions) SetPolicyID(policyID string) *UpdatePolicyStateOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdatePolicyStateOptions) SetIfMatch(ifMatch string) *UpdatePolicyStateOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetState : Allow user to set State +func (_options *UpdatePolicyStateOptions) SetState(state string) *UpdatePolicyStateOptions { + _options.State = core.StringPtr(state) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdatePolicyStateOptions) SetHeaders(param map[string]string) *UpdatePolicyStateOptions { + options.Headers = param + return options +} + +// UpdateSettingsOptions : The UpdateSettings options. +type UpdateSettingsOptions struct { + // The account GUID that the settings belong to. + AccountID *string `json:"account_id" validate:"required,ne="` + + // The revision number for updating Access Management Account Settings and must match the ETag value of the existing + // Access Management Account Settings. The Etag can be retrieved using the GET + // /v1/accounts/{account_id}/settings/access_management API and looking at the ETag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // Update to how external accounts can interact in relation to the requested account. + ExternalAccountIdentityInteraction *ExternalAccountIdentityInteractionPatch `json:"external_account_identity_interaction,omitempty"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewUpdateSettingsOptions : Instantiate UpdateSettingsOptions +func (*IamPolicyManagementV1) NewUpdateSettingsOptions(accountID string, ifMatch string) *UpdateSettingsOptions { + return &UpdateSettingsOptions{ + AccountID: core.StringPtr(accountID), + IfMatch: core.StringPtr(ifMatch), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *UpdateSettingsOptions) SetAccountID(accountID string) *UpdateSettingsOptions { + _options.AccountID = core.StringPtr(accountID) return _options } // SetIfMatch : Allow user to set IfMatch -func (_options *UpdatePolicyStateOptions) SetIfMatch(ifMatch string) *UpdatePolicyStateOptions { +func (_options *UpdateSettingsOptions) SetIfMatch(ifMatch string) *UpdateSettingsOptions { _options.IfMatch = core.StringPtr(ifMatch) return _options } -// SetState : Allow user to set State -func (_options *UpdatePolicyStateOptions) SetState(state string) *UpdatePolicyStateOptions { - _options.State = core.StringPtr(state) +// SetExternalAccountIdentityInteraction : Allow user to set ExternalAccountIdentityInteraction +func (_options *UpdateSettingsOptions) SetExternalAccountIdentityInteraction(externalAccountIdentityInteraction *ExternalAccountIdentityInteractionPatch) *UpdateSettingsOptions { + _options.ExternalAccountIdentityInteraction = externalAccountIdentityInteraction + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *UpdateSettingsOptions) SetAcceptLanguage(acceptLanguage string) *UpdateSettingsOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) return _options } // SetHeaders : Allow user to set Headers -func (options *UpdatePolicyStateOptions) SetHeaders(param map[string]string) *UpdatePolicyStateOptions { +func (options *UpdateSettingsOptions) SetHeaders(param map[string]string) *UpdateSettingsOptions { options.Headers = param return options } @@ -7748,82 +7419,66 @@ func UnmarshalV2Policy(m map[string]json.RawMessage, result interface{}) (err er obj := new(V2Policy) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalV2PolicySubject) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource", &obj.Resource, UnmarshalV2PolicyResource) if err != nil { - err = core.SDKErrorf(err, "", "resource-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "pattern", &obj.Pattern) if err != nil { - err = core.SDKErrorf(err, "", "pattern-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "rule", &obj.Rule, UnmarshalV2PolicyRule) if err != nil { - err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControlResponse) if err != nil { - err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_at", &obj.LastPermitAt) if err != nil { - err = core.SDKErrorf(err, "", "last_permit_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_frequency", &obj.LastPermitFrequency) if err != nil { - err = core.SDKErrorf(err, "", "last_permit_frequency-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7841,7 +7496,6 @@ func UnmarshalV2PolicyCollection(m map[string]json.RawMessage, result interface{ obj := new(V2PolicyCollection) err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalV2PolicyTemplateMetaData) if err != nil { - err = core.SDKErrorf(err, "", "policies-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7863,9 +7517,6 @@ func (*IamPolicyManagementV1) NewV2PolicyResource(attributes []V2PolicyResourceA Attributes: attributes, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7874,12 +7525,10 @@ func UnmarshalV2PolicyResource(m map[string]json.RawMessage, result interface{}) obj := new(V2PolicyResource) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalV2PolicyResourceAttribute) if err != nil { - err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tags", &obj.Tags, UnmarshalV2PolicyResourceTag) if err != nil { - err = core.SDKErrorf(err, "", "tags-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7917,9 +7566,6 @@ func (*IamPolicyManagementV1) NewV2PolicyResourceAttribute(key string, operator Value: value, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7928,17 +7574,14 @@ func UnmarshalV2PolicyResourceAttribute(m map[string]json.RawMessage, result int obj := new(V2PolicyResourceAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7972,9 +7615,6 @@ func (*IamPolicyManagementV1) NewV2PolicyResourceTag(key string, value string, o Operator: core.StringPtr(operator), } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -7983,17 +7623,14 @@ func UnmarshalV2PolicyResourceTag(m map[string]json.RawMessage, result interface obj := new(V2PolicyResourceTag) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8056,22 +7693,18 @@ func UnmarshalV2PolicyRule(m map[string]json.RawMessage, result interface{}) (er obj := new(V2PolicyRule) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalNestedCondition) if err != nil { - err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8090,9 +7723,6 @@ func (*IamPolicyManagementV1) NewV2PolicySubject(attributes []V2PolicySubjectAtt Attributes: attributes, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -8101,7 +7731,6 @@ func UnmarshalV2PolicySubject(m map[string]json.RawMessage, result interface{}) obj := new(V2PolicySubject) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalV2PolicySubjectAttribute) if err != nil { - err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8136,9 +7765,6 @@ func (*IamPolicyManagementV1) NewV2PolicySubjectAttribute(key string, operator s Value: value, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -8147,17 +7773,14 @@ func UnmarshalV2PolicySubjectAttribute(m map[string]json.RawMessage, result inte obj := new(V2PolicySubjectAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8239,87 +7862,70 @@ func UnmarshalV2PolicyTemplateMetaData(m map[string]json.RawMessage, result inte obj := new(V2PolicyTemplateMetaData) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalV2PolicySubject) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource", &obj.Resource, UnmarshalV2PolicyResource) if err != nil { - err = core.SDKErrorf(err, "", "resource-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "pattern", &obj.Pattern) if err != nil { - err = core.SDKErrorf(err, "", "pattern-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "rule", &obj.Rule, UnmarshalV2PolicyRule) if err != nil { - err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControlResponse) if err != nil { - err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_at", &obj.LastPermitAt) if err != nil { - err = core.SDKErrorf(err, "", "last_permit_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_frequency", &obj.LastPermitFrequency) if err != nil { - err = core.SDKErrorf(err, "", "last_permit_frequency-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8342,7 +7948,6 @@ func UnmarshalControlResponseControl(m map[string]json.RawMessage, result interf obj := new(ControlResponseControl) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8365,285 +7970,6 @@ func UnmarshalControlResponseControlWithEnrichedRoles(m map[string]json.RawMessa obj := new(ControlResponseControlWithEnrichedRoles) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrantWithEnrichedRoles) if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetPolicyAssignmentResponsePolicyAssignment : The set of properties associated with the policy template assignment. -// This model "extends" GetPolicyAssignmentResponse -type GetPolicyAssignmentResponsePolicyAssignment struct { - // policy template id. - TemplateID *string `json:"template_id,omitempty"` - - // policy template version. - TemplateVersion *string `json:"template_version,omitempty"` - - // Passed in value to correlate with other assignments. - AssignmentID *string `json:"assignment_id,omitempty"` - - // Assignment target type. - TargetType *string `json:"target_type,omitempty"` - - // ID of the target account. - Target *string `json:"target,omitempty"` - - // List of objects with required properties for a policy assignment. - Options []PolicyAssignmentOptions `json:"options,omitempty"` - - // Policy assignment ID. - ID *string `json:"id,omitempty"` - - // The account GUID that the policies assignments belong to.. - AccountID *string `json:"account_id,omitempty"` - - // The href URL that links to the policies assignments API by policy assignment ID. - Href *string `json:"href,omitempty"` - - // The UTC timestamp when the policy assignment was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - - // The iam ID of the entity that created the policy assignment. - CreatedByID *string `json:"created_by_id,omitempty"` - - // The UTC timestamp when the policy assignment was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` - - // The iam ID of the entity that last modified the policy assignment. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` - - // Object for each account assigned. - Resources []PolicyAssignmentResources `json:"resources,omitempty"` - - // The policy assignment status. - Status *string `json:"status,omitempty"` -} - -// Constants associated with the GetPolicyAssignmentResponsePolicyAssignment.TargetType property. -// Assignment target type. -const ( - GetPolicyAssignmentResponsePolicyAssignmentTargetTypeAccountConst = "Account" -) - -// Constants associated with the GetPolicyAssignmentResponsePolicyAssignment.Status property. -// The policy assignment status. -const ( - GetPolicyAssignmentResponsePolicyAssignmentStatusFailedConst = "failed" - GetPolicyAssignmentResponsePolicyAssignmentStatusInProgressConst = "in_progress" - GetPolicyAssignmentResponsePolicyAssignmentStatusSucceedWithErrorsConst = "succeed_with_errors" - GetPolicyAssignmentResponsePolicyAssignmentStatusSucceededConst = "succeeded" -) - -func (*GetPolicyAssignmentResponsePolicyAssignment) isaGetPolicyAssignmentResponse() bool { - return true -} - -// UnmarshalGetPolicyAssignmentResponsePolicyAssignment unmarshals an instance of GetPolicyAssignmentResponsePolicyAssignment from the specified map of raw messages. -func UnmarshalGetPolicyAssignmentResponsePolicyAssignment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetPolicyAssignmentResponsePolicyAssignment) - 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, "assignment_id", &obj.AssignmentID) - if err != nil { - err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "target_type", &obj.TargetType) - if err != nil { - err = core.SDKErrorf(err, "", "target_type-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "target", &obj.Target) - if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentOptions) - if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentResources) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// GetPolicyAssignmentResponsePolicyAssignmentV1 : The set of properties associated with the policy template assignment. -// This model "extends" GetPolicyAssignmentResponse -type GetPolicyAssignmentResponsePolicyAssignmentV1 struct { - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` - - // The set of properties required for a policy assignment. - Options *PolicyAssignmentV1Options `json:"options" validate:"required"` - - // Policy assignment ID. - ID *string `json:"id,omitempty"` - - // The account GUID that the policies assignments belong to.. - AccountID *string `json:"account_id,omitempty"` - - // The href URL that links to the policies assignments API by policy assignment ID. - Href *string `json:"href,omitempty"` - - // The UTC timestamp when the policy assignment was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - - // The iam ID of the entity that created the policy assignment. - CreatedByID *string `json:"created_by_id,omitempty"` - - // The UTC timestamp when the policy assignment was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` - - // The iam ID of the entity that last modified the policy assignment. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` - - // Object for each account assigned. - Resources []PolicyAssignmentV1Resources `json:"resources" validate:"required"` - - // subject details of access type assignment. - Subject *GetPolicyAssignmentResponsePolicyAssignmentV1Subject `json:"subject,omitempty"` - - // policy template details. - Template *AssignmentTemplateDetails `json:"template" validate:"required"` - - // The policy assignment status. - Status *string `json:"status" validate:"required"` -} - -// Constants associated with the GetPolicyAssignmentResponsePolicyAssignmentV1.Status property. -// The policy assignment status. -const ( - GetPolicyAssignmentResponsePolicyAssignmentV1StatusFailedConst = "failed" - GetPolicyAssignmentResponsePolicyAssignmentV1StatusInProgressConst = "in_progress" - GetPolicyAssignmentResponsePolicyAssignmentV1StatusSucceedWithErrorsConst = "succeed_with_errors" - GetPolicyAssignmentResponsePolicyAssignmentV1StatusSucceededConst = "succeeded" -) - -func (*GetPolicyAssignmentResponsePolicyAssignmentV1) isaGetPolicyAssignmentResponse() bool { - return true -} - -// UnmarshalGetPolicyAssignmentResponsePolicyAssignmentV1 unmarshals an instance of GetPolicyAssignmentResponsePolicyAssignmentV1 from the specified map of raw messages. -func UnmarshalGetPolicyAssignmentResponsePolicyAssignmentV1(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(GetPolicyAssignmentResponsePolicyAssignmentV1) - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) - if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) - if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalGetPolicyAssignmentResponsePolicyAssignmentV1Subject) - if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) - if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) - if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8696,9 +8022,6 @@ func (*IamPolicyManagementV1) NewNestedConditionRuleAttribute(key string, operat Value: value, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -8711,17 +8034,14 @@ func UnmarshalNestedConditionRuleAttribute(m map[string]json.RawMessage, result obj := new(NestedConditionRuleAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8753,9 +8073,6 @@ func (*IamPolicyManagementV1) NewNestedConditionRuleWithConditions(operator stri Conditions: conditions, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -8768,12 +8085,10 @@ func UnmarshalNestedConditionRuleWithConditions(m map[string]json.RawMessage, re obj := new(NestedConditionRuleWithConditions) err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalRuleAttribute) if err != nil { - err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8853,77 +8168,62 @@ func UnmarshalPolicyTemplateAssignmentItemsPolicyAssignment(m map[string]json.Ra obj := new(PolicyTemplateAssignmentItemsPolicyAssignment) 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, "assignment_id", &obj.AssignmentID) if err != nil { - err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "target_type", &obj.TargetType) if err != nil { - err = core.SDKErrorf(err, "", "target_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "target", &obj.Target) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentOptions) if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentResources) if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8991,67 +8291,54 @@ func UnmarshalPolicyTemplateAssignmentItemsPolicyAssignmentV1(m map[string]json. obj := new(PolicyTemplateAssignmentItemsPolicyAssignmentV1) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) if err != nil { - err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -9104,9 +8391,6 @@ func (*IamPolicyManagementV1) NewV2PolicyRuleRuleAttribute(key string, operator Value: value, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -9119,17 +8403,14 @@ func UnmarshalV2PolicyRuleRuleAttribute(m map[string]json.RawMessage, result int obj := new(V2PolicyRuleRuleAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { - err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -9161,9 +8442,6 @@ func (*IamPolicyManagementV1) NewV2PolicyRuleRuleWithNestedConditions(operator s Conditions: conditions, } err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } return } @@ -9176,12 +8454,10 @@ func UnmarshalV2PolicyRuleRuleWithNestedConditions(m map[string]json.RawMessage, obj := new(V2PolicyRuleRuleWithNestedConditions) err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalNestedCondition) if err != nil { - err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) diff --git a/iampolicymanagementv1/iam_policy_management_v1_examples_test.go b/iampolicymanagementv1/iam_policy_management_v1_examples_test.go index 6ffaf671..1b20c358 100644 --- a/iampolicymanagementv1/iam_policy_management_v1_examples_test.go +++ b/iampolicymanagementv1/iam_policy_management_v1_examples_test.go @@ -75,6 +75,7 @@ var _ = Describe(`IamPolicyManagementV1 Examples Tests`, func() { exampleAssignmentRequesterId string = "IBMid-" + strconv.Itoa(rand.Intn(100000)) assignmentID string = "orchestrator-id" examplePolicyAssignmentETag string = "" + exampleAccountSettingsETag string exampleETagHeader string = "ETag" ) @@ -1104,7 +1105,7 @@ var _ = Describe(`IamPolicyManagementV1 Examples Tests`, func() { Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(policyAssignmentRecord).ToNot(BeNil()) - var assignmentDetails = policyAssignmentRecord.(*iampolicymanagementv1.GetPolicyAssignmentResponse) + var assignmentDetails = policyAssignmentRecord.(*iampolicymanagementv1.PolicyTemplateAssignmentItems) Expect(*assignmentDetails.Template.ID).ToNot(BeNil()) Expect(*assignmentDetails.Target.Type).ToNot(BeNil()) Expect(*assignmentDetails.Template.Version).ToNot(BeNil()) @@ -1200,5 +1201,66 @@ var _ = Describe(`IamPolicyManagementV1 Examples Tests`, func() { Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) }) + + It(`GetSettings request example`, func() { + fmt.Println("\nGetSettings() result:") + // begin-get_settings + + getSettingsOptions := iamPolicyManagementService.NewGetSettingsOptions( + exampleAccountID, + ) + + accountSettingsAccessManagement, response, err := iamPolicyManagementService.GetSettings(getSettingsOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(accountSettingsAccessManagement, "", " ") + exampleAccountSettingsETag = response.GetHeaders().Get("ETag") + fmt.Println(string(b)) + + // end-get_settings + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(accountSettingsAccessManagement).ToNot(BeNil()) + }) + + It(`UpdateSettings request example`, func() { + fmt.Println("\nUpdateSettings() result:") + // begin-update_settings + + updateSettingsOptions := iamPolicyManagementService.NewUpdateSettingsOptions( + exampleAccountID, + exampleAccountSettingsETag, + ) + identityTypesBase := &iampolicymanagementv1.IdentityTypesBase{ + State: core.StringPtr("monitor"), + ExternalAllowedAccounts: []string{}, + } + + identityTypes := &iampolicymanagementv1.IdentityTypesPatch{ + User: identityTypesBase, + ServiceID: identityTypesBase, + Service: identityTypesBase, + } + + externalAccountIdentityInteraction := &iampolicymanagementv1.ExternalAccountIdentityInteractionPatch{ + IdentityTypes: identityTypes, + } + updateSettingsOptions.SetExternalAccountIdentityInteraction(externalAccountIdentityInteraction) + + accountSettingsAccessManagement, response, err := iamPolicyManagementService.UpdateSettings(updateSettingsOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(accountSettingsAccessManagement, "", " ") + fmt.Println(string(b)) + + // end-update_settings + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(accountSettingsAccessManagement).ToNot(BeNil()) + }) }) }) diff --git a/iampolicymanagementv1/iam_policy_management_v1_integration_test.go b/iampolicymanagementv1/iam_policy_management_v1_integration_test.go index 8f6e9314..f35ab7cd 100644 --- a/iampolicymanagementv1/iam_policy_management_v1_integration_test.go +++ b/iampolicymanagementv1/iam_policy_management_v1_integration_test.go @@ -74,6 +74,8 @@ var _ = Describe("IAM Policy Management - Integration Tests", func() { assignmentID string = "orchestrator-id" testPolicyAssignmentETag string = "" testTargetType string = "Account" + + testAcountSettingsETag string = "" ) var shouldSkipTest = func() { @@ -1164,7 +1166,7 @@ var _ = Describe("IAM Policy Management - Integration Tests", func() { policyAssignmentRecord, response, err := service.GetPolicyAssignment(getPolicyAssignmentOptions) Expect(err).To(BeNil()) - var assignmentDetails = policyAssignmentRecord.(*iampolicymanagementv1.GetPolicyAssignmentResponse) + var assignmentDetails = policyAssignmentRecord.(*iampolicymanagementv1.PolicyTemplateAssignmentItems) Expect(response.StatusCode).To(Equal(200)) Expect(*assignmentDetails).ToNot(BeNil()) Expect(*assignmentDetails.Template.ID).ToNot(BeNil()) @@ -1265,6 +1267,58 @@ var _ = Describe("IAM Policy Management - Integration Tests", func() { }) }) + Describe(`GetSettings - Retrieve Access Management account settings by account ID`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`GetSettings(getSettingsOptions *GetSettingsOptions)`, func() { + getSettingsOptions := &iampolicymanagementv1.GetSettingsOptions{ + AccountID: &testAccountID, + AcceptLanguage: core.StringPtr("default"), + } + + accountSettingsAccessManagement, response, err := service.GetSettings(getSettingsOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(accountSettingsAccessManagement).ToNot(BeNil()) + testAcountSettingsETag = response.GetHeaders().Get(etagHeader) + }) + }) + + Describe(`UpdateSettings - Updates Access Management account settings by account ID`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`UpdateSettings(updateSettingsOptions *UpdateSettingsOptions)`, func() { + identityTypesBaseModel := &iampolicymanagementv1.IdentityTypesBase{ + State: core.StringPtr("monitor"), + ExternalAllowedAccounts: []string{}, + } + + identityTypesPatchModel := &iampolicymanagementv1.IdentityTypesPatch{ + User: identityTypesBaseModel, + ServiceID: identityTypesBaseModel, + Service: identityTypesBaseModel, + } + + externalAccountIdentityInteractionPatchModel := &iampolicymanagementv1.ExternalAccountIdentityInteractionPatch{ + IdentityTypes: identityTypesPatchModel, + } + + updateSettingsOptions := &iampolicymanagementv1.UpdateSettingsOptions{ + AccountID: &testAccountID, + IfMatch: &testAcountSettingsETag, + ExternalAccountIdentityInteraction: externalAccountIdentityInteractionPatchModel, + AcceptLanguage: core.StringPtr("default"), + } + + accountSettingsAccessManagement, response, err := service.UpdateSettings(updateSettingsOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(accountSettingsAccessManagement).ToNot(BeNil()) + }) + }) + // clean up all test groups AfterSuite(func() { if !configLoaded { diff --git a/iampolicymanagementv1/iam_policy_management_v1_test.go b/iampolicymanagementv1/iam_policy_management_v1_test.go index 98f48f83..b512e270 100644 --- a/iampolicymanagementv1/iam_policy_management_v1_test.go +++ b/iampolicymanagementv1/iam_policy_management_v1_test.go @@ -19,7 +19,6 @@ package iampolicymanagementv1_test import ( "bytes" "context" - "encoding/json" "fmt" "io" "net/http" @@ -3277,7 +3276,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3287,7 +3286,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3304,7 +3303,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3398,7 +3397,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3408,7 +3407,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3425,7 +3424,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3527,7 +3526,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3537,7 +3536,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3554,7 +3553,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3599,7 +3598,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3609,7 +3608,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3626,7 +3625,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3692,7 +3691,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3702,7 +3701,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3719,7 +3718,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3787,7 +3786,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3797,7 +3796,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3814,7 +3813,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -3909,7 +3908,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3919,7 +3918,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3936,7 +3935,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4039,7 +4038,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4049,7 +4048,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4066,7 +4065,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4112,7 +4111,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4122,7 +4121,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4139,7 +4138,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4206,7 +4205,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4216,7 +4215,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4233,7 +4232,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4852,7 +4851,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4869,7 +4868,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4879,7 +4878,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -4981,7 +4980,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4998,7 +4997,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5008,7 +5007,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5118,7 +5117,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5135,7 +5134,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5145,7 +5144,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5198,7 +5197,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5215,7 +5214,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5225,7 +5224,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5299,7 +5298,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5316,7 +5315,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5326,7 +5325,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5688,7 +5687,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5705,7 +5704,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5715,7 +5714,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5814,7 +5813,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5831,7 +5830,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5841,7 +5840,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5948,7 +5947,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5965,7 +5964,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5975,7 +5974,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6027,7 +6026,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6044,7 +6043,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6054,7 +6053,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6127,7 +6126,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6144,7 +6143,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6154,7 +6153,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6449,7 +6448,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6466,7 +6465,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6476,7 +6475,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6579,7 +6578,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6596,7 +6595,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6606,7 +6605,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6717,7 +6716,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6734,7 +6733,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6744,7 +6743,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6798,7 +6797,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6815,7 +6814,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6825,7 +6824,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6900,7 +6899,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6917,7 +6916,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6927,7 +6926,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -8536,6 +8535,575 @@ var _ = Describe(`IamPolicyManagementV1`, func() { }) }) }) + Describe(`GetSettings(getSettingsOptions *GetSettingsOptions) - Operation response error`, func() { + getSettingsPath := "/v1/accounts/testString/settings/access_management" + 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(getSettingsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Accept-Language"]).ToNot(BeNil()) + Expect(req.Header["Accept-Language"][0]).To(Equal(fmt.Sprintf("%v", "default"))) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetSettings with error: Operation response processing error`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Construct an instance of the GetSettingsOptions model + getSettingsOptionsModel := new(iampolicymanagementv1.GetSettingsOptions) + getSettingsOptionsModel.AccountID = core.StringPtr("testString") + getSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + getSettingsOptionsModel.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 := iamPolicyManagementService.GetSettings(getSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + iamPolicyManagementService.EnableRetries(0, 0) + result, response, operationErr = iamPolicyManagementService.GetSettings(getSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetSettings(getSettingsOptions *GetSettingsOptions)`, func() { + getSettingsPath := "/v1/accounts/testString/settings/access_management" + 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(getSettingsPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.Header["Accept-Language"]).ToNot(BeNil()) + Expect(req.Header["Accept-Language"][0]).To(Equal(fmt.Sprintf("%v", "default"))) + // 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", `{"external_account_identity_interaction": {"identity_types": {"user": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service_id": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}}}}`) + })) + }) + It(`Invoke GetSettings successfully with retries`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + iamPolicyManagementService.EnableRetries(0, 0) + + // Construct an instance of the GetSettingsOptions model + getSettingsOptionsModel := new(iampolicymanagementv1.GetSettingsOptions) + getSettingsOptionsModel.AccountID = core.StringPtr("testString") + getSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + getSettingsOptionsModel.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 := iamPolicyManagementService.GetSettingsWithContext(ctx, getSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + iamPolicyManagementService.DisableRetries() + result, response, operationErr := iamPolicyManagementService.GetSettings(getSettingsOptionsModel) + 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 = iamPolicyManagementService.GetSettingsWithContext(ctx, getSettingsOptionsModel) + 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(getSettingsPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.Header["Accept-Language"]).ToNot(BeNil()) + Expect(req.Header["Accept-Language"][0]).To(Equal(fmt.Sprintf("%v", "default"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"external_account_identity_interaction": {"identity_types": {"user": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service_id": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}}}}`) + })) + }) + It(`Invoke GetSettings successfully`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := iamPolicyManagementService.GetSettings(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the GetSettingsOptions model + getSettingsOptionsModel := new(iampolicymanagementv1.GetSettingsOptions) + getSettingsOptionsModel.AccountID = core.StringPtr("testString") + getSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + getSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = iamPolicyManagementService.GetSettings(getSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke GetSettings with error: Operation validation and request error`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Construct an instance of the GetSettingsOptions model + getSettingsOptionsModel := new(iampolicymanagementv1.GetSettingsOptions) + getSettingsOptionsModel.AccountID = core.StringPtr("testString") + getSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + getSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := iamPolicyManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := iamPolicyManagementService.GetSettings(getSettingsOptionsModel) + 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 GetSettingsOptions model with no property values + getSettingsOptionsModelNew := new(iampolicymanagementv1.GetSettingsOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = iamPolicyManagementService.GetSettings(getSettingsOptionsModelNew) + 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 GetSettings successfully`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Construct an instance of the GetSettingsOptions model + getSettingsOptionsModel := new(iampolicymanagementv1.GetSettingsOptions) + getSettingsOptionsModel.AccountID = core.StringPtr("testString") + getSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + getSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := iamPolicyManagementService.GetSettings(getSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`UpdateSettings(updateSettingsOptions *UpdateSettingsOptions) - Operation response error`, func() { + updateSettingsPath := "/v1/accounts/testString/settings/access_management" + 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(updateSettingsPath)) + Expect(req.Method).To(Equal("PATCH")) + Expect(req.Header["If-Match"]).ToNot(BeNil()) + Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Accept-Language"]).ToNot(BeNil()) + Expect(req.Header["Accept-Language"][0]).To(Equal(fmt.Sprintf("%v", "default"))) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke UpdateSettings with error: Operation response processing error`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Construct an instance of the IdentityTypesBase model + identityTypesBaseModel := new(iampolicymanagementv1.IdentityTypesBase) + identityTypesBaseModel.State = core.StringPtr("enabled") + identityTypesBaseModel.ExternalAllowedAccounts = []string{"testString"} + + // Construct an instance of the IdentityTypesPatch model + identityTypesPatchModel := new(iampolicymanagementv1.IdentityTypesPatch) + identityTypesPatchModel.User = identityTypesBaseModel + identityTypesPatchModel.ServiceID = identityTypesBaseModel + identityTypesPatchModel.Service = identityTypesBaseModel + + // Construct an instance of the ExternalAccountIdentityInteractionPatch model + externalAccountIdentityInteractionPatchModel := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + externalAccountIdentityInteractionPatchModel.IdentityTypes = identityTypesPatchModel + + // Construct an instance of the UpdateSettingsOptions model + updateSettingsOptionsModel := new(iampolicymanagementv1.UpdateSettingsOptions) + updateSettingsOptionsModel.AccountID = core.StringPtr("testString") + updateSettingsOptionsModel.IfMatch = core.StringPtr("testString") + updateSettingsOptionsModel.ExternalAccountIdentityInteraction = externalAccountIdentityInteractionPatchModel + updateSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + updateSettingsOptionsModel.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 := iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + iamPolicyManagementService.EnableRetries(0, 0) + result, response, operationErr = iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`UpdateSettings(updateSettingsOptions *UpdateSettingsOptions)`, func() { + updateSettingsPath := "/v1/accounts/testString/settings/access_management" + 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(updateSettingsPath)) + Expect(req.Method).To(Equal("PATCH")) + + // For gzip-disabled operation, verify Content-Encoding is not set. + Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + + // If there is a body, then make sure we can read it + bodyBuf := new(bytes.Buffer) + if req.Header.Get("Content-Encoding") == "gzip" { + body, err := core.NewGzipDecompressionReader(req.Body) + Expect(err).To(BeNil()) + _, err = bodyBuf.ReadFrom(body) + Expect(err).To(BeNil()) + } else { + _, err := bodyBuf.ReadFrom(req.Body) + Expect(err).To(BeNil()) + } + fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + + Expect(req.Header["If-Match"]).ToNot(BeNil()) + Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Accept-Language"]).ToNot(BeNil()) + Expect(req.Header["Accept-Language"][0]).To(Equal(fmt.Sprintf("%v", "default"))) + // 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", `{"external_account_identity_interaction": {"identity_types": {"user": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service_id": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}}}}`) + })) + }) + It(`Invoke UpdateSettings successfully with retries`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + iamPolicyManagementService.EnableRetries(0, 0) + + // Construct an instance of the IdentityTypesBase model + identityTypesBaseModel := new(iampolicymanagementv1.IdentityTypesBase) + identityTypesBaseModel.State = core.StringPtr("enabled") + identityTypesBaseModel.ExternalAllowedAccounts = []string{"testString"} + + // Construct an instance of the IdentityTypesPatch model + identityTypesPatchModel := new(iampolicymanagementv1.IdentityTypesPatch) + identityTypesPatchModel.User = identityTypesBaseModel + identityTypesPatchModel.ServiceID = identityTypesBaseModel + identityTypesPatchModel.Service = identityTypesBaseModel + + // Construct an instance of the ExternalAccountIdentityInteractionPatch model + externalAccountIdentityInteractionPatchModel := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + externalAccountIdentityInteractionPatchModel.IdentityTypes = identityTypesPatchModel + + // Construct an instance of the UpdateSettingsOptions model + updateSettingsOptionsModel := new(iampolicymanagementv1.UpdateSettingsOptions) + updateSettingsOptionsModel.AccountID = core.StringPtr("testString") + updateSettingsOptionsModel.IfMatch = core.StringPtr("testString") + updateSettingsOptionsModel.ExternalAccountIdentityInteraction = externalAccountIdentityInteractionPatchModel + updateSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + updateSettingsOptionsModel.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 := iamPolicyManagementService.UpdateSettingsWithContext(ctx, updateSettingsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + iamPolicyManagementService.DisableRetries() + result, response, operationErr := iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModel) + 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 = iamPolicyManagementService.UpdateSettingsWithContext(ctx, updateSettingsOptionsModel) + 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(updateSettingsPath)) + Expect(req.Method).To(Equal("PATCH")) + + // For gzip-disabled operation, verify Content-Encoding is not set. + Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + + // If there is a body, then make sure we can read it + bodyBuf := new(bytes.Buffer) + if req.Header.Get("Content-Encoding") == "gzip" { + body, err := core.NewGzipDecompressionReader(req.Body) + Expect(err).To(BeNil()) + _, err = bodyBuf.ReadFrom(body) + Expect(err).To(BeNil()) + } else { + _, err := bodyBuf.ReadFrom(req.Body) + Expect(err).To(BeNil()) + } + fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + + Expect(req.Header["If-Match"]).ToNot(BeNil()) + Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Accept-Language"]).ToNot(BeNil()) + Expect(req.Header["Accept-Language"][0]).To(Equal(fmt.Sprintf("%v", "default"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"external_account_identity_interaction": {"identity_types": {"user": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service_id": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}, "service": {"state": "enabled", "external_allowed_accounts": ["ExternalAllowedAccounts"]}}}}`) + })) + }) + It(`Invoke UpdateSettings successfully`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := iamPolicyManagementService.UpdateSettings(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the IdentityTypesBase model + identityTypesBaseModel := new(iampolicymanagementv1.IdentityTypesBase) + identityTypesBaseModel.State = core.StringPtr("enabled") + identityTypesBaseModel.ExternalAllowedAccounts = []string{"testString"} + + // Construct an instance of the IdentityTypesPatch model + identityTypesPatchModel := new(iampolicymanagementv1.IdentityTypesPatch) + identityTypesPatchModel.User = identityTypesBaseModel + identityTypesPatchModel.ServiceID = identityTypesBaseModel + identityTypesPatchModel.Service = identityTypesBaseModel + + // Construct an instance of the ExternalAccountIdentityInteractionPatch model + externalAccountIdentityInteractionPatchModel := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + externalAccountIdentityInteractionPatchModel.IdentityTypes = identityTypesPatchModel + + // Construct an instance of the UpdateSettingsOptions model + updateSettingsOptionsModel := new(iampolicymanagementv1.UpdateSettingsOptions) + updateSettingsOptionsModel.AccountID = core.StringPtr("testString") + updateSettingsOptionsModel.IfMatch = core.StringPtr("testString") + updateSettingsOptionsModel.ExternalAccountIdentityInteraction = externalAccountIdentityInteractionPatchModel + updateSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + updateSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke UpdateSettings with error: Operation validation and request error`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Construct an instance of the IdentityTypesBase model + identityTypesBaseModel := new(iampolicymanagementv1.IdentityTypesBase) + identityTypesBaseModel.State = core.StringPtr("enabled") + identityTypesBaseModel.ExternalAllowedAccounts = []string{"testString"} + + // Construct an instance of the IdentityTypesPatch model + identityTypesPatchModel := new(iampolicymanagementv1.IdentityTypesPatch) + identityTypesPatchModel.User = identityTypesBaseModel + identityTypesPatchModel.ServiceID = identityTypesBaseModel + identityTypesPatchModel.Service = identityTypesBaseModel + + // Construct an instance of the ExternalAccountIdentityInteractionPatch model + externalAccountIdentityInteractionPatchModel := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + externalAccountIdentityInteractionPatchModel.IdentityTypes = identityTypesPatchModel + + // Construct an instance of the UpdateSettingsOptions model + updateSettingsOptionsModel := new(iampolicymanagementv1.UpdateSettingsOptions) + updateSettingsOptionsModel.AccountID = core.StringPtr("testString") + updateSettingsOptionsModel.IfMatch = core.StringPtr("testString") + updateSettingsOptionsModel.ExternalAccountIdentityInteraction = externalAccountIdentityInteractionPatchModel + updateSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + updateSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := iamPolicyManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModel) + 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 UpdateSettingsOptions model with no property values + updateSettingsOptionsModelNew := new(iampolicymanagementv1.UpdateSettingsOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModelNew) + 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 UpdateSettings successfully`, func() { + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(iamPolicyManagementService).ToNot(BeNil()) + + // Construct an instance of the IdentityTypesBase model + identityTypesBaseModel := new(iampolicymanagementv1.IdentityTypesBase) + identityTypesBaseModel.State = core.StringPtr("enabled") + identityTypesBaseModel.ExternalAllowedAccounts = []string{"testString"} + + // Construct an instance of the IdentityTypesPatch model + identityTypesPatchModel := new(iampolicymanagementv1.IdentityTypesPatch) + identityTypesPatchModel.User = identityTypesBaseModel + identityTypesPatchModel.ServiceID = identityTypesBaseModel + identityTypesPatchModel.Service = identityTypesBaseModel + + // Construct an instance of the ExternalAccountIdentityInteractionPatch model + externalAccountIdentityInteractionPatchModel := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + externalAccountIdentityInteractionPatchModel.IdentityTypes = identityTypesPatchModel + + // Construct an instance of the UpdateSettingsOptions model + updateSettingsOptionsModel := new(iampolicymanagementv1.UpdateSettingsOptions) + updateSettingsOptionsModel.AccountID = core.StringPtr("testString") + updateSettingsOptionsModel.IfMatch = core.StringPtr("testString") + updateSettingsOptionsModel.ExternalAccountIdentityInteraction = externalAccountIdentityInteractionPatchModel + updateSettingsOptionsModel.AcceptLanguage = core.StringPtr("default") + updateSettingsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := iamPolicyManagementService.UpdateSettings(updateSettingsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) Describe(`Model constructor tests`, func() { Context(`Using a service client instance`, func() { iamPolicyManagementService, _ := iampolicymanagementv1.NewIamPolicyManagementV1(&iampolicymanagementv1.IamPolicyManagementV1Options{ @@ -8698,10 +9266,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -8726,10 +9294,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -8742,10 +9310,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal("testString")) + Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -8810,10 +9378,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -8838,10 +9406,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -8854,10 +9422,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal("testString")) + Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -8963,10 +9531,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -8979,10 +9547,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -9007,10 +9575,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal("testString")) + Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the CreateV2PolicyOptions model var createV2PolicyOptionsControl *iampolicymanagementv1.Control = nil @@ -9157,6 +9725,18 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(getRoleOptionsModel.RoleID).To(Equal(core.StringPtr("testString"))) Expect(getRoleOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) + It(`Invoke NewGetSettingsOptions successfully`, func() { + // Construct an instance of the GetSettingsOptions model + accountID := "testString" + getSettingsOptionsModel := iamPolicyManagementService.NewGetSettingsOptions(accountID) + getSettingsOptionsModel.SetAccountID("testString") + getSettingsOptionsModel.SetAcceptLanguage("default") + getSettingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getSettingsOptionsModel).ToNot(BeNil()) + Expect(getSettingsOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(getSettingsOptionsModel.AcceptLanguage).To(Equal(core.StringPtr("default"))) + Expect(getSettingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) It(`Invoke NewGetV2PolicyOptions successfully`, func() { // Construct an instance of the GetV2PolicyOptions model id := "testString" @@ -9175,6 +9755,13 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) + It(`Invoke NewIdentityTypesBase successfully`, func() { + state := "enabled" + externalAllowedAccounts := []string{"testString"} + _model, err := iamPolicyManagementService.NewIdentityTypesBase(state, externalAllowedAccounts) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) It(`Invoke NewListPoliciesOptions successfully`, func() { // Construct an instance of the ListPoliciesOptions model accountID := "testString" @@ -9401,10 +9988,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -9429,10 +10016,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -9445,10 +10032,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal("testString")) + Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -9555,10 +10142,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = "testString" + v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -9571,10 +10158,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = "testString" + v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -9599,10 +10186,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = "testString" + v2PolicyRuleModel.Value = core.StringPtr("testString") Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal("testString")) + Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the ReplaceV2PolicyOptions model id := "testString" @@ -9662,7 +10249,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewRuleAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := "testString" + value := core.StringPtr("testString") _model, err := iamPolicyManagementService.NewRuleAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -9715,6 +10302,47 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(updatePolicyStateOptionsModel.State).To(Equal(core.StringPtr("active"))) Expect(updatePolicyStateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) + It(`Invoke NewUpdateSettingsOptions successfully`, func() { + // Construct an instance of the IdentityTypesBase model + identityTypesBaseModel := new(iampolicymanagementv1.IdentityTypesBase) + Expect(identityTypesBaseModel).ToNot(BeNil()) + identityTypesBaseModel.State = core.StringPtr("enabled") + identityTypesBaseModel.ExternalAllowedAccounts = []string{"testString"} + Expect(identityTypesBaseModel.State).To(Equal(core.StringPtr("enabled"))) + Expect(identityTypesBaseModel.ExternalAllowedAccounts).To(Equal([]string{"testString"})) + + // Construct an instance of the IdentityTypesPatch model + identityTypesPatchModel := new(iampolicymanagementv1.IdentityTypesPatch) + Expect(identityTypesPatchModel).ToNot(BeNil()) + identityTypesPatchModel.User = identityTypesBaseModel + identityTypesPatchModel.ServiceID = identityTypesBaseModel + identityTypesPatchModel.Service = identityTypesBaseModel + Expect(identityTypesPatchModel.User).To(Equal(identityTypesBaseModel)) + Expect(identityTypesPatchModel.ServiceID).To(Equal(identityTypesBaseModel)) + Expect(identityTypesPatchModel.Service).To(Equal(identityTypesBaseModel)) + + // Construct an instance of the ExternalAccountIdentityInteractionPatch model + externalAccountIdentityInteractionPatchModel := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + Expect(externalAccountIdentityInteractionPatchModel).ToNot(BeNil()) + externalAccountIdentityInteractionPatchModel.IdentityTypes = identityTypesPatchModel + Expect(externalAccountIdentityInteractionPatchModel.IdentityTypes).To(Equal(identityTypesPatchModel)) + + // Construct an instance of the UpdateSettingsOptions model + accountID := "testString" + ifMatch := "testString" + updateSettingsOptionsModel := iamPolicyManagementService.NewUpdateSettingsOptions(accountID, ifMatch) + updateSettingsOptionsModel.SetAccountID("testString") + updateSettingsOptionsModel.SetIfMatch("testString") + updateSettingsOptionsModel.SetExternalAccountIdentityInteraction(externalAccountIdentityInteractionPatchModel) + updateSettingsOptionsModel.SetAcceptLanguage("default") + updateSettingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateSettingsOptionsModel).ToNot(BeNil()) + Expect(updateSettingsOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(updateSettingsOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) + Expect(updateSettingsOptionsModel.ExternalAccountIdentityInteraction).To(Equal(externalAccountIdentityInteractionPatchModel)) + Expect(updateSettingsOptionsModel.AcceptLanguage).To(Equal(core.StringPtr("default"))) + Expect(updateSettingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) It(`Invoke NewV2PolicyResource successfully`, func() { attributes := []iampolicymanagementv1.V2PolicyResourceAttribute{} _model, err := iamPolicyManagementService.NewV2PolicyResource(attributes) @@ -9724,7 +10352,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewV2PolicyResourceAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := "testString" + value := core.StringPtr("testString") _model, err := iamPolicyManagementService.NewV2PolicyResourceAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -9746,7 +10374,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewV2PolicySubjectAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := "testString" + value := core.StringPtr("testString") _model, err := iamPolicyManagementService.NewV2PolicySubjectAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -9754,7 +10382,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewNestedConditionRuleAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := "testString" + value := core.StringPtr("testString") _model, err := iamPolicyManagementService.NewNestedConditionRuleAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -9769,7 +10397,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewV2PolicyRuleRuleAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := "testString" + value := core.StringPtr("testString") _model, err := iamPolicyManagementService.NewV2PolicyRuleRuleAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -9783,556 +10411,6 @@ var _ = Describe(`IamPolicyManagementV1`, func() { }) }) }) - Describe(`Model unmarshaling tests`, func() { - It(`Invoke UnmarshalAssignmentTargetDetails successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.AssignmentTargetDetails) - model.Type = core.StringPtr("Account") - model.ID = core.StringPtr("testString") - - 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 *iampolicymanagementv1.AssignmentTargetDetails - err = iampolicymanagementv1.UnmarshalAssignmentTargetDetails(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalAssignmentTemplateDetails successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.AssignmentTemplateDetails) - model.ID = core.StringPtr("testString") - model.Version = core.StringPtr("testString") - - 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 *iampolicymanagementv1.AssignmentTemplateDetails - err = iampolicymanagementv1.UnmarshalAssignmentTemplateDetails(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalControl successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.Control) - model.Grant = 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 *iampolicymanagementv1.Control - err = iampolicymanagementv1.UnmarshalControl(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalGrant successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.Grant) - model.Roles = 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 *iampolicymanagementv1.Grant - err = iampolicymanagementv1.UnmarshalGrant(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalNestedCondition successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.NestedCondition) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - model.Conditions = 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 *iampolicymanagementv1.NestedCondition - err = iampolicymanagementv1.UnmarshalNestedCondition(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalPolicyAssignmentV1Options successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.PolicyAssignmentV1Options) - model.Root = 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 *iampolicymanagementv1.PolicyAssignmentV1Options - err = iampolicymanagementv1.UnmarshalPolicyAssignmentV1Options(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalPolicyAssignmentV1OptionsRoot successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.PolicyAssignmentV1OptionsRoot) - model.RequesterID = core.StringPtr("testString") - model.AssignmentID = core.StringPtr("testString") - model.Template = 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 *iampolicymanagementv1.PolicyAssignmentV1OptionsRoot - err = iampolicymanagementv1.UnmarshalPolicyAssignmentV1OptionsRoot(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalPolicyAssignmentV1OptionsRootTemplate successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.PolicyAssignmentV1OptionsRootTemplate) - model.ID = core.StringPtr("testString") - model.Version = core.StringPtr("testString") - - 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 *iampolicymanagementv1.PolicyAssignmentV1OptionsRootTemplate - err = iampolicymanagementv1.UnmarshalPolicyAssignmentV1OptionsRootTemplate(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalPolicyResource successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.PolicyResource) - model.Attributes = nil - model.Tags = 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 *iampolicymanagementv1.PolicyResource - err = iampolicymanagementv1.UnmarshalPolicyResource(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalPolicyRole successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.PolicyRole) - model.RoleID = core.StringPtr("testString") - model.DisplayName = core.StringPtr("testString") - model.Description = core.StringPtr("testString") - - 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 *iampolicymanagementv1.PolicyRole - err = iampolicymanagementv1.UnmarshalPolicyRole(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalPolicySubject successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.PolicySubject) - model.Attributes = 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 *iampolicymanagementv1.PolicySubject - err = iampolicymanagementv1.UnmarshalPolicySubject(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalResourceAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.ResourceAttribute) - model.Name = core.StringPtr("testString") - model.Value = core.StringPtr("testString") - model.Operator = core.StringPtr("testString") - - 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 *iampolicymanagementv1.ResourceAttribute - err = iampolicymanagementv1.UnmarshalResourceAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalResourceTag successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.ResourceTag) - model.Name = core.StringPtr("testString") - model.Value = core.StringPtr("testString") - model.Operator = core.StringPtr("testString") - - 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 *iampolicymanagementv1.ResourceTag - err = iampolicymanagementv1.UnmarshalResourceTag(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalRole successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.Role) - model.DisplayName = core.StringPtr("testString") - model.Description = core.StringPtr("testString") - model.Actions = []string{"testString"} - model.CRN = core.StringPtr("testString") - - 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 *iampolicymanagementv1.Role - err = iampolicymanagementv1.UnmarshalRole(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalRoles successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.Roles) - model.RoleID = core.StringPtr("testString") - - 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 *iampolicymanagementv1.Roles - err = iampolicymanagementv1.UnmarshalRoles(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalRuleAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.RuleAttribute) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - - 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 *iampolicymanagementv1.RuleAttribute - err = iampolicymanagementv1.UnmarshalRuleAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalSubjectAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.SubjectAttribute) - model.Name = core.StringPtr("testString") - model.Value = core.StringPtr("testString") - - 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 *iampolicymanagementv1.SubjectAttribute - err = iampolicymanagementv1.UnmarshalSubjectAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalTemplatePolicy successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.TemplatePolicy) - model.Type = core.StringPtr("access") - model.Description = core.StringPtr("testString") - model.Resource = nil - model.Subject = nil - model.Pattern = core.StringPtr("testString") - model.Rule = nil - model.Control = 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 *iampolicymanagementv1.TemplatePolicy - err = iampolicymanagementv1.UnmarshalTemplatePolicy(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicyResource successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicyResource) - model.Attributes = nil - model.Tags = 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 *iampolicymanagementv1.V2PolicyResource - err = iampolicymanagementv1.UnmarshalV2PolicyResource(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicyResourceAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicyResourceAttribute) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - - 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 *iampolicymanagementv1.V2PolicyResourceAttribute - err = iampolicymanagementv1.UnmarshalV2PolicyResourceAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicyResourceTag successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicyResourceTag) - model.Key = core.StringPtr("testString") - model.Value = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - - 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 *iampolicymanagementv1.V2PolicyResourceTag - err = iampolicymanagementv1.UnmarshalV2PolicyResourceTag(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicyRule successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicyRule) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - model.Conditions = 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 *iampolicymanagementv1.V2PolicyRule - err = iampolicymanagementv1.UnmarshalV2PolicyRule(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicySubject successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicySubject) - model.Attributes = 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 *iampolicymanagementv1.V2PolicySubject - err = iampolicymanagementv1.UnmarshalV2PolicySubject(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicySubjectAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicySubjectAttribute) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - - 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 *iampolicymanagementv1.V2PolicySubjectAttribute - err = iampolicymanagementv1.UnmarshalV2PolicySubjectAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalNestedConditionRuleAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.NestedConditionRuleAttribute) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - - 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 *iampolicymanagementv1.NestedConditionRuleAttribute - err = iampolicymanagementv1.UnmarshalNestedConditionRuleAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalNestedConditionRuleWithConditions successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.NestedConditionRuleWithConditions) - model.Operator = core.StringPtr("and") - model.Conditions = 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 *iampolicymanagementv1.NestedConditionRuleWithConditions - err = iampolicymanagementv1.UnmarshalNestedConditionRuleWithConditions(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicyRuleRuleAttribute successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) - model.Key = core.StringPtr("testString") - model.Operator = core.StringPtr("stringEquals") - model.Value = "testString" - - 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 *iampolicymanagementv1.V2PolicyRuleRuleAttribute - err = iampolicymanagementv1.UnmarshalV2PolicyRuleRuleAttribute(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - It(`Invoke UnmarshalV2PolicyRuleRuleWithNestedConditions successfully`, func() { - // Construct an instance of the model. - model := new(iampolicymanagementv1.V2PolicyRuleRuleWithNestedConditions) - model.Operator = core.StringPtr("and") - model.Conditions = 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 *iampolicymanagementv1.V2PolicyRuleRuleWithNestedConditions - err = iampolicymanagementv1.UnmarshalV2PolicyRuleRuleWithNestedConditions(raw, &result) - Expect(err).To(BeNil()) - Expect(result).ToNot(BeNil()) - Expect(result).To(Equal(model)) - }) - }) - Describe(`Utility function tests`, func() { It(`Invoke CreateMockByteArray() successfully`, func() { mockByteArray := CreateMockByteArray("This is a test") @@ -10362,7 +10440,8 @@ var _ = Describe(`IamPolicyManagementV1`, func() { // func CreateMockByteArray(mockData string) *[]byte { - ba := []byte(mockData) + ba := make([]byte, 0) + ba = append(ba, mockData...) return &ba } From 0a307db0b826c7032196bf14ea11a95b578bcc60 Mon Sep 17 00:00:00 2001 From: Shaun Colley Date: Tue, 4 Jun 2024 15:00:22 -0400 Subject: [PATCH 2/2] fix(IAM Policy Management): regen using latest sdk generator and lint Signed-off-by: Shaun Colley --- .../iam_policy_management_v1.go | 1432 ++++++++++++----- .../iam_policy_management_v1_examples_test.go | 6 +- ...m_policy_management_v1_integration_test.go | 14 +- .../iam_policy_management_v1_test.go | 853 ++++++++-- 4 files changed, 1814 insertions(+), 491 deletions(-) diff --git a/iampolicymanagementv1/iam_policy_management_v1.go b/iampolicymanagementv1/iam_policy_management_v1.go index 75646bba..8974b4c4 100644 --- a/iampolicymanagementv1/iam_policy_management_v1.go +++ b/iampolicymanagementv1/iam_policy_management_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 + * IBM OpenAPI SDK Code Generator Version: 3.90.1-64fd3296-20240515-180710 */ // Package iampolicymanagementv1 : Operations and models for the IamPolicyManagementV1 service @@ -63,22 +63,26 @@ func NewIamPolicyManagementV1UsingExternalConfig(options *IamPolicyManagementV1O if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } iamPolicyManagement, err = NewIamPolicyManagementV1(options) + err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = iamPolicyManagement.Service.ConfigureService(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = iamPolicyManagement.Service.SetServiceURL(options.URL) + err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -92,12 +96,14 @@ func NewIamPolicyManagementV1(options *IamPolicyManagementV1Options) (service *I baseService, err := core.NewBaseService(serviceOptions) if err != nil { + err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { + err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -111,7 +117,7 @@ func NewIamPolicyManagementV1(options *IamPolicyManagementV1Options) (service *I // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { - return "", fmt.Errorf("service does not support regional URLs") + return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) } // Clone makes a copy of "iamPolicyManagement" suitable for processing requests. @@ -126,7 +132,11 @@ func (iamPolicyManagement *IamPolicyManagementV1) Clone() *IamPolicyManagementV1 // SetServiceURL sets the service URL func (iamPolicyManagement *IamPolicyManagementV1) SetServiceURL(url string) error { - return iamPolicyManagement.Service.SetServiceURL(url) + err := iamPolicyManagement.Service.SetServiceURL(url) + if err != nil { + err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) + } + return err } // GetServiceURL returns the service URL @@ -167,17 +177,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) DisableRetries() { // parameter. Only policies that have the specified attributes and that the caller has read access to are returned. If // the caller does not have read access to any policies an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicies(listPoliciesOptions *ListPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ListPoliciesWithContext(context.Background(), listPoliciesOptions) + result, response, err = iamPolicyManagement.ListPoliciesWithContext(context.Background(), listPoliciesOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListPoliciesWithContext is an alternate form of the ListPolicies method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx context.Context, listPoliciesOptions *ListPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPoliciesOptions, "listPoliciesOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPoliciesOptions, "listPoliciesOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -186,6 +200,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -233,17 +248,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_policies", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -277,7 +296,9 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co // their support of authorization policies. To create an authorization policy, use **`"type": "authorization"`** in the // body. The subject attributes must match the supported authorization subjects of the resource. Multiple subject // attributes might be provided. The following attributes are supported: -// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// +// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// // supported by the service or platform roles. For more information, see [IAM roles and // actions](/docs/account?topic=account-iam-service-roles-actions). The user must also have the same level of access or // greater to the target resource in order to grant the role. Use only the resource attributes supported by the service. @@ -297,17 +318,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPoliciesWithContext(ctx co // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicy(createPolicyOptions *CreatePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { - return iamPolicyManagement.CreatePolicyWithContext(context.Background(), createPolicyOptions) + result, response, err = iamPolicyManagement.CreatePolicyWithContext(context.Background(), createPolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreatePolicyWithContext is an alternate form of the CreatePolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx context.Context, createPolicyOptions *CreatePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyOptions, "createPolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyOptions, "createPolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -316,6 +341,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -351,22 +377,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicy) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -395,7 +426,9 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co // To update an authorization policy, use **`"type": "authorization"`** in the body. The subject attributes must match // the supported authorization subjects of the resource. Multiple subject attributes might be provided. The following // attributes are supported: -// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// +// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// // supported by the service or platform roles. For more information, see [IAM roles and // actions](/docs/account?topic=account-iam-service-roles-actions). The user must also have the same level of access or // greater to the target resource in order to grant the role. Use only the resource attributes supported by the service. @@ -415,17 +448,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyWithContext(ctx co // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicy(replacePolicyOptions *ReplacePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ReplacePolicyWithContext(context.Background(), replacePolicyOptions) + result, response, err = iamPolicyManagement.ReplacePolicyWithContext(context.Background(), replacePolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ReplacePolicyWithContext is an alternate form of the ReplacePolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx context.Context, replacePolicyOptions *ReplacePolicyOptions) (result *Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replacePolicyOptions, "replacePolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replacePolicyOptions, "replacePolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -438,6 +475,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx c builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -473,22 +511,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx c } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "replace_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicy) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -500,17 +543,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyWithContext(ctx c // GetPolicy : Retrieve a policy by ID // Retrieve a policy by providing a policy ID. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicy(getPolicyOptions *GetPolicyOptions) (result *PolicyTemplateMetaData, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetPolicyWithContext(context.Background(), getPolicyOptions) + result, response, err = iamPolicyManagement.GetPolicyWithContext(context.Background(), getPolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetPolicyWithContext is an alternate form of the GetPolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx context.Context, getPolicyOptions *GetPolicyOptions) (result *PolicyTemplateMetaData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyOptions, "getPolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyOptions, "getPolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -523,6 +570,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx conte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -538,17 +586,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx conte request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateMetaData) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -561,17 +613,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyWithContext(ctx conte // Delete a policy by providing a policy ID. A policy cannot be deleted if the subject ID contains a locked service ID. // If the subject of the policy is a locked service-id, the request will fail. func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicy(deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.DeletePolicyWithContext(context.Background(), deletePolicyOptions) + response, err = iamPolicyManagement.DeletePolicyWithContext(context.Background(), deletePolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeletePolicyWithContext is an alternate form of the DeletePolicy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx context.Context, deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyOptions, "deletePolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyOptions, "deletePolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -584,6 +640,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx co builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -598,10 +655,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx co request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -610,17 +673,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyWithContext(ctx co // Restore a policy that has recently been deleted. A policy administrator might want to restore a deleted policy. To // restore a policy, use **`"state": "active"`** in the body. func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyState(updatePolicyStateOptions *UpdatePolicyStateOptions) (result *Policy, response *core.DetailedResponse, err error) { - return iamPolicyManagement.UpdatePolicyStateWithContext(context.Background(), updatePolicyStateOptions) + result, response, err = iamPolicyManagement.UpdatePolicyStateWithContext(context.Background(), updatePolicyStateOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdatePolicyStateWithContext is an alternate form of the UpdatePolicyState method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(ctx context.Context, updatePolicyStateOptions *UpdatePolicyStateOptions) (result *Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updatePolicyStateOptions, "updatePolicyStateOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updatePolicyStateOptions, "updatePolicyStateOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -633,6 +700,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(c builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policies/{policy_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -656,22 +724,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(c } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_policy_state", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicy) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -687,13 +760,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyStateWithContext(c // exclusive. Only roles that match the filter and that the caller has read access to are returned. If the caller does // not have read access to any roles an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListRoles(listRolesOptions *ListRolesOptions) (result *RoleCollection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ListRolesWithContext(context.Background(), listRolesOptions) + result, response, err = iamPolicyManagement.ListRolesWithContext(context.Background(), listRolesOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListRolesWithContext is an alternate form of the ListRoles method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx context.Context, listRolesOptions *ListRolesOptions) (result *RoleCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listRolesOptions, "listRolesOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -702,6 +778,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx conte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -736,17 +813,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx conte request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_roles", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -761,17 +842,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListRolesWithContext(ctx conte // service can be mapped to the new role, but there must be at least one service-defined action to successfully create // the new role. func (iamPolicyManagement *IamPolicyManagementV1) CreateRole(createRoleOptions *CreateRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { - return iamPolicyManagement.CreateRoleWithContext(context.Background(), createRoleOptions) + result, response, err = iamPolicyManagement.CreateRoleWithContext(context.Background(), createRoleOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateRoleWithContext is an alternate form of the CreateRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx context.Context, createRoleOptions *CreateRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createRoleOptions, "createRoleOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createRoleOptions, "createRoleOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -780,6 +865,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx cont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -818,22 +904,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx cont } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_role", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCustomRole) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -846,17 +937,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleWithContext(ctx cont // Update a custom role. A role administrator might want to update an existing role by updating the display name, // description, or the actions that are mapped to the role. The name, account_id, and service_name can't be changed. func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRole(replaceRoleOptions *ReplaceRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ReplaceRoleWithContext(context.Background(), replaceRoleOptions) + result, response, err = iamPolicyManagement.ReplaceRoleWithContext(context.Background(), replaceRoleOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ReplaceRoleWithContext is an alternate form of the ReplaceRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx context.Context, replaceRoleOptions *ReplaceRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replaceRoleOptions, "replaceRoleOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replaceRoleOptions, "replaceRoleOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -869,6 +964,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx con builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles/{role_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -898,22 +994,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx con } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "replace_role", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCustomRole) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -925,17 +1026,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleWithContext(ctx con // GetRole : Retrieve a role by ID // Retrieve a role by providing a role ID. func (iamPolicyManagement *IamPolicyManagementV1) GetRole(getRoleOptions *GetRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetRoleWithContext(context.Background(), getRoleOptions) + result, response, err = iamPolicyManagement.GetRoleWithContext(context.Background(), getRoleOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetRoleWithContext is an alternate form of the GetRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context.Context, getRoleOptions *GetRoleOptions) (result *CustomRole, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getRoleOptions, "getRoleOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getRoleOptions, "getRoleOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -948,6 +1053,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles/{role_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -963,17 +1069,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_role", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCustomRole) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -985,17 +1095,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetRoleWithContext(ctx context // DeleteRole : Delete a role by ID // Delete a role by providing a role ID. func (iamPolicyManagement *IamPolicyManagementV1) DeleteRole(deleteRoleOptions *DeleteRoleOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.DeleteRoleWithContext(context.Background(), deleteRoleOptions) + response, err = iamPolicyManagement.DeleteRoleWithContext(context.Background(), deleteRoleOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteRoleWithContext is an alternate form of the DeleteRole method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx context.Context, deleteRoleOptions *DeleteRoleOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteRoleOptions, "deleteRoleOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteRoleOptions, "deleteRoleOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1008,6 +1122,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx cont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/roles/{role_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1022,10 +1137,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx cont request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_role", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1037,17 +1158,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleWithContext(ctx cont // parameter. Only policies that have the specified attributes and that the caller has read access to are returned. If // the caller does not have read access to any policies an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListV2Policies(listV2PoliciesOptions *ListV2PoliciesOptions) (result *V2PolicyCollection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ListV2PoliciesWithContext(context.Background(), listV2PoliciesOptions) + result, response, err = iamPolicyManagement.ListV2PoliciesWithContext(context.Background(), listV2PoliciesOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListV2PoliciesWithContext is an alternate form of the ListV2Policies method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx context.Context, listV2PoliciesOptions *ListV2PoliciesOptions) (result *V2PolicyCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listV2PoliciesOptions, "listV2PoliciesOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listV2PoliciesOptions, "listV2PoliciesOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1056,6 +1181,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1103,17 +1229,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_v2_policies", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2PolicyCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1148,28 +1278,32 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx // Monday-Friday work week). For example, a policy can grant access Monday-Friday, 9:00am-5:00pm using the following // rule: // ```json -// "rule": { -// "operator": "and", -// "conditions": [{ -// "key": "{{environment.attributes.day_of_week}}", -// "operator": "dayOfWeekAnyOf", -// "value": ["1+00:00", "2+00:00", "3+00:00", "4+00:00", "5+00:00"] -// }, -// "key": "{{environment.attributes.current_time}}", -// "operator": "timeGreaterThanOrEquals", -// "value": "09:00:00+00:00" -// }, -// "key": "{{environment.attributes.current_time}}", -// "operator": "timeLessThanOrEquals", -// "value": "17:00:00+00:00" -// }] -// } +// +// "rule": { +// "operator": "and", +// "conditions": [{ +// "key": "{{environment.attributes.day_of_week}}", +// "operator": "dayOfWeekAnyOf", +// "value": ["1+00:00", "2+00:00", "3+00:00", "4+00:00", "5+00:00"] +// }, +// "key": "{{environment.attributes.current_time}}", +// "operator": "timeGreaterThanOrEquals", +// "value": "09:00:00+00:00" +// }, +// "key": "{{environment.attributes.current_time}}", +// "operator": "timeLessThanOrEquals", +// "value": "17:00:00+00:00" +// }] +// } +// // ``` You can use the following operators in the **`key`** and **`value`** pair: // ``` -// 'timeLessThan', 'timeLessThanOrEquals', 'timeGreaterThan', 'timeGreaterThanOrEquals', -// 'dateLessThan', 'dateLessThanOrEquals', 'dateGreaterThan', 'dateGreaterThanOrEquals', -// 'dateTimeLessThan', 'dateTimeLessThanOrEquals', 'dateTimeGreaterThan', 'dateTimeGreaterThanOrEquals', -// 'dayOfWeekEquals', 'dayOfWeekAnyOf' +// +// 'timeLessThan', 'timeLessThanOrEquals', 'timeGreaterThan', 'timeGreaterThanOrEquals', +// 'dateLessThan', 'dateLessThanOrEquals', 'dateGreaterThan', 'dateGreaterThanOrEquals', +// 'dateTimeLessThan', 'dateTimeLessThanOrEquals', 'dateTimeGreaterThan', 'dateTimeGreaterThanOrEquals', +// 'dayOfWeekEquals', 'dayOfWeekAnyOf' +// // ``` The pattern field that matches the rule is required when rule is provided. For the business hour rule example // above, the **`pattern`** is **`"time-based-conditions:weekly"`**. For more information, see [Time-based conditions // operators](/docs/account?topic=account-iam-condition-properties&interface=ui#policy-condition-properties) and @@ -1182,32 +1316,34 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx // // For example, a policy can grant access based on multiple conditions applied on the resource attributes below: // ```json -// "pattern": "attribute-based-condition:resource:literal-and-wildcard" -// "rule": { -// "operator": "or", -// "conditions": [ -// { -// "operator": "and", -// "conditions": [ -// { -// "key": "{{resource.attributes.prefix}}", -// "operator": "stringEquals", -// "value": "home/test" -// }, -// { -// "key": "{{environment.attributes.delimiter}}", -// "operator": "stringEquals", -// "value": "/" -// } -// ] -// }, -// { -// "key": "{{resource.attributes.path}}", -// "operator": "stringMatch", -// "value": "home/David/_*" -// } -// ] -// } +// +// "pattern": "attribute-based-condition:resource:literal-and-wildcard" +// "rule": { +// "operator": "or", +// "conditions": [ +// { +// "operator": "and", +// "conditions": [ +// { +// "key": "{{resource.attributes.prefix}}", +// "operator": "stringEquals", +// "value": "home/test" +// }, +// { +// "key": "{{environment.attributes.delimiter}}", +// "operator": "stringEquals", +// "value": "/" +// } +// ] +// }, +// { +// "key": "{{resource.attributes.path}}", +// "operator": "stringMatch", +// "value": "home/David/_*" +// } +// ] +// } +// // ``` // // In addition to satisfying the `resources` section, the policy grants permission only if either the `path` begins with @@ -1222,7 +1358,9 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx // their support of authorization policies. To create an authorization policy, use **`"type": "authorization"`** in the // body. The subject attributes must match the supported authorization subjects of the resource. Multiple subject // attributes might be provided. The following attributes are supported: -// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// +// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// // supported by the service or platform roles. For more information, see [IAM roles and // actions](/docs/account?topic=account-iam-service-roles-actions). The user must also have the same level of access or // greater to the target resource in order to grant the role. Use only the resource attributes supported by the service. @@ -1241,17 +1379,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListV2PoliciesWithContext(ctx // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) CreateV2Policy(createV2PolicyOptions *CreateV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { - return iamPolicyManagement.CreateV2PolicyWithContext(context.Background(), createV2PolicyOptions) + result, response, err = iamPolicyManagement.CreateV2PolicyWithContext(context.Background(), createV2PolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateV2PolicyWithContext is an alternate form of the CreateV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx context.Context, createV2PolicyOptions *CreateV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createV2PolicyOptions, "createV2PolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createV2PolicyOptions, "createV2PolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1260,6 +1402,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1301,22 +1444,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_v2_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2Policy) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1350,28 +1498,32 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx // Monday-Friday work week). For example, a policy can grant access Monday-Friday, 9:00am-5:00pm using the following // rule: // ```json -// "rule": { -// "operator": "and", -// "conditions": [{ -// "key": "{{environment.attributes.day_of_week}}", -// "operator": "dayOfWeekAnyOf", -// "value": ["1+00:00", "2+00:00", "3+00:00", "4+00:00", "5+00:00"] -// }, -// "key": "{{environment.attributes.current_time}}", -// "operator": "timeGreaterThanOrEquals", -// "value": "09:00:00+00:00" -// }, -// "key": "{{environment.attributes.current_time}}", -// "operator": "timeLessThanOrEquals", -// "value": "17:00:00+00:00" -// }] -// } +// +// "rule": { +// "operator": "and", +// "conditions": [{ +// "key": "{{environment.attributes.day_of_week}}", +// "operator": "dayOfWeekAnyOf", +// "value": ["1+00:00", "2+00:00", "3+00:00", "4+00:00", "5+00:00"] +// }, +// "key": "{{environment.attributes.current_time}}", +// "operator": "timeGreaterThanOrEquals", +// "value": "09:00:00+00:00" +// }, +// "key": "{{environment.attributes.current_time}}", +// "operator": "timeLessThanOrEquals", +// "value": "17:00:00+00:00" +// }] +// } +// // ``` You can use the following operators in the **`key`** and **`value`** pair: // ``` -// 'timeLessThan', 'timeLessThanOrEquals', 'timeGreaterThan', 'timeGreaterThanOrEquals', -// 'dateLessThan', 'dateLessThanOrEquals', 'dateGreaterThan', 'dateGreaterThanOrEquals', -// 'dateTimeLessThan', 'dateTimeLessThanOrEquals', 'dateTimeGreaterThan', 'dateTimeGreaterThanOrEquals', -// 'dayOfWeekEquals', 'dayOfWeekAnyOf' +// +// 'timeLessThan', 'timeLessThanOrEquals', 'timeGreaterThan', 'timeGreaterThanOrEquals', +// 'dateLessThan', 'dateLessThanOrEquals', 'dateGreaterThan', 'dateGreaterThanOrEquals', +// 'dateTimeLessThan', 'dateTimeLessThanOrEquals', 'dateTimeGreaterThan', 'dateTimeGreaterThanOrEquals', +// 'dayOfWeekEquals', 'dayOfWeekAnyOf' +// // ``` The pattern field that matches the rule is required when rule is provided. For the business hour rule example // above, the **`pattern`** is **`"time-based-conditions:weekly"`**. For more information, see [Time-based conditions // operators](/docs/account?topic=account-iam-condition-properties&interface=ui#policy-condition-properties) and @@ -1384,32 +1536,34 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx // // For example, a policy can grant access based on multiple conditions applied on the resource attributes below: // ```json -// "pattern": "attribute-based-condition:resource:literal-and-wildcard" -// "rule": { -// "operator": "or", -// "conditions": [ -// { -// "operator": "and", -// "conditions": [ -// { -// "key": "{{resource.attributes.prefix}}", -// "operator": "stringEquals", -// "value": "home/test" -// }, -// { -// "key": "{{environment.attributes.delimiter}}", -// "operator": "stringEquals", -// "value": "/" -// } -// ] -// }, -// { -// "key": "{{resource.attributes.path}}", -// "operator": "stringMatch", -// "value": "home/David/_*" -// } -// ] -// } +// +// "pattern": "attribute-based-condition:resource:literal-and-wildcard" +// "rule": { +// "operator": "or", +// "conditions": [ +// { +// "operator": "and", +// "conditions": [ +// { +// "key": "{{resource.attributes.prefix}}", +// "operator": "stringEquals", +// "value": "home/test" +// }, +// { +// "key": "{{environment.attributes.delimiter}}", +// "operator": "stringEquals", +// "value": "/" +// } +// ] +// }, +// { +// "key": "{{resource.attributes.path}}", +// "operator": "stringMatch", +// "value": "home/David/_*" +// } +// ] +// } +// // ``` // // In addition to satisfying the `resources` section, the policy grants permission only if either the `path` begins with @@ -1423,7 +1577,9 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx // To update an authorization policy, use **`"type": "authorization"`** in the body. The subject attributes must match // the supported authorization subjects of the resource. Multiple subject attributes might be provided. The following // attributes are supported: -// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// +// serviceName, serviceInstance, region, resourceType, resource, accountId, resourceGroupId Assign roles that are +// // supported by the service or platform roles. For more information, see [IAM roles and // actions](/docs/account?topic=account-iam-service-roles-actions). The user must also have the same level of access or // greater to the target resource in order to grant the role. Use only the resource attributes supported by the service. @@ -1442,17 +1598,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreateV2PolicyWithContext(ctx // geography, country, metro, region, satellite, and locationvalues are supported by the service, they are validated // against Global Catalog locations. func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2Policy(replaceV2PolicyOptions *ReplaceV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ReplaceV2PolicyWithContext(context.Background(), replaceV2PolicyOptions) + result, response, err = iamPolicyManagement.ReplaceV2PolicyWithContext(context.Background(), replaceV2PolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ReplaceV2PolicyWithContext is an alternate form of the ReplaceV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx context.Context, replaceV2PolicyOptions *ReplaceV2PolicyOptions) (result *V2Policy, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replaceV2PolicyOptions, "replaceV2PolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replaceV2PolicyOptions, "replaceV2PolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1465,6 +1625,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1506,22 +1667,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "replace_v2_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2Policy) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1533,17 +1699,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplaceV2PolicyWithContext(ctx // GetV2Policy : Retrieve a policy by ID // Retrieve a policy by providing a policy ID. func (iamPolicyManagement *IamPolicyManagementV1) GetV2Policy(getV2PolicyOptions *GetV2PolicyOptions) (result *V2PolicyTemplateMetaData, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetV2PolicyWithContext(context.Background(), getV2PolicyOptions) + result, response, err = iamPolicyManagement.GetV2PolicyWithContext(context.Background(), getV2PolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetV2PolicyWithContext is an alternate form of the GetV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx context.Context, getV2PolicyOptions *GetV2PolicyOptions) (result *V2PolicyTemplateMetaData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getV2PolicyOptions, "getV2PolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getV2PolicyOptions, "getV2PolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1556,6 +1726,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx con builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1575,17 +1746,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx con request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_v2_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalV2PolicyTemplateMetaData) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1598,17 +1773,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetV2PolicyWithContext(ctx con // Delete a policy by providing a policy ID. A policy cannot be deleted if the subject ID contains a locked service ID. // If the subject of the policy is a locked service-id, the request will fail. func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2Policy(deleteV2PolicyOptions *DeleteV2PolicyOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.DeleteV2PolicyWithContext(context.Background(), deleteV2PolicyOptions) + response, err = iamPolicyManagement.DeleteV2PolicyWithContext(context.Background(), deleteV2PolicyOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteV2PolicyWithContext is an alternate form of the DeleteV2Policy method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx context.Context, deleteV2PolicyOptions *DeleteV2PolicyOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteV2PolicyOptions, "deleteV2PolicyOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteV2PolicyOptions, "deleteV2PolicyOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1621,6 +1800,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v2/policies/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1635,10 +1815,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_v2_policy", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1651,17 +1837,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteV2PolicyWithContext(ctx // the caller has read access to are returned. If the caller does not have read access to any policy templates an empty // array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplates(listPolicyTemplatesOptions *ListPolicyTemplatesOptions) (result *PolicyTemplateCollection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ListPolicyTemplatesWithContext(context.Background(), listPolicyTemplatesOptions) + result, response, err = iamPolicyManagement.ListPolicyTemplatesWithContext(context.Background(), listPolicyTemplatesOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListPolicyTemplatesWithContext is an alternate form of the ListPolicyTemplates method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext(ctx context.Context, listPolicyTemplatesOptions *ListPolicyTemplatesOptions) (result *PolicyTemplateCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPolicyTemplatesOptions, "listPolicyTemplatesOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPolicyTemplatesOptions, "listPolicyTemplatesOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1670,6 +1860,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1708,17 +1899,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_policy_templates", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1731,17 +1926,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplatesWithContext // Create a policy template. Policy templates define a policy without requiring a subject, and you can use them to grant // access to multiple subjects. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplate(createPolicyTemplateOptions *CreatePolicyTemplateOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { - return iamPolicyManagement.CreatePolicyTemplateWithContext(context.Background(), createPolicyTemplateOptions) + result, response, err = iamPolicyManagement.CreatePolicyTemplateWithContext(context.Background(), createPolicyTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreatePolicyTemplateWithContext is an alternate form of the CreatePolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContext(ctx context.Context, createPolicyTemplateOptions *CreatePolicyTemplateOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyTemplateOptions, "createPolicyTemplateOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyTemplateOptions, "createPolicyTemplateOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1750,6 +1949,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContex builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1785,22 +1985,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContex } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_policy_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateLimitData) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1812,17 +2017,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateWithContex // GetPolicyTemplate : Retrieve latest version of a policy template // Retrieve the latest version of a policy template by providing a policy template ID. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplate(getPolicyTemplateOptions *GetPolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetPolicyTemplateWithContext(context.Background(), getPolicyTemplateOptions) + result, response, err = iamPolicyManagement.GetPolicyTemplateWithContext(context.Background(), getPolicyTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetPolicyTemplateWithContext is an alternate form of the GetPolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(ctx context.Context, getPolicyTemplateOptions *GetPolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyTemplateOptions, "getPolicyTemplateOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyTemplateOptions, "getPolicyTemplateOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1835,6 +2044,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(c builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1854,17 +2064,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(c request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_policy_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplate) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1878,17 +2092,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateWithContext(c // template can't be deleted if any version of the template is assigned to one or more child accounts. You must remove // the policy assignments first. func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplate(deletePolicyTemplateOptions *DeletePolicyTemplateOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.DeletePolicyTemplateWithContext(context.Background(), deletePolicyTemplateOptions) + response, err = iamPolicyManagement.DeletePolicyTemplateWithContext(context.Background(), deletePolicyTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeletePolicyTemplateWithContext is an alternate form of the DeletePolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContext(ctx context.Context, deletePolicyTemplateOptions *DeletePolicyTemplateOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyTemplateOptions, "deletePolicyTemplateOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyTemplateOptions, "deletePolicyTemplateOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1901,6 +2119,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContex builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1915,10 +2134,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContex request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_policy_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1927,17 +2152,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateWithContex // Create a new version of a policy template. Use this if you need to make updates to a policy template that is // committed. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersion(createPolicyTemplateVersionOptions *CreatePolicyTemplateVersionOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { - return iamPolicyManagement.CreatePolicyTemplateVersionWithContext(context.Background(), createPolicyTemplateVersionOptions) + result, response, err = iamPolicyManagement.CreatePolicyTemplateVersionWithContext(context.Background(), createPolicyTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreatePolicyTemplateVersionWithContext is an alternate form of the CreatePolicyTemplateVersion method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWithContext(ctx context.Context, createPolicyTemplateVersionOptions *CreatePolicyTemplateVersionOptions) (result *PolicyTemplateLimitData, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyTemplateVersionOptions, "createPolicyTemplateVersionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyTemplateVersionOptions, "createPolicyTemplateVersionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1950,6 +2179,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWit builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -1979,22 +2209,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWit } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_policy_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateLimitData) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2006,17 +2241,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateVersionWit // ListPolicyTemplateVersions : Retrieve policy template versions // Retrieve the versions of a policy template by providing a policy template ID. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersions(listPolicyTemplateVersionsOptions *ListPolicyTemplateVersionsOptions) (result *PolicyTemplateVersionsCollection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ListPolicyTemplateVersionsWithContext(context.Background(), listPolicyTemplateVersionsOptions) + result, response, err = iamPolicyManagement.ListPolicyTemplateVersionsWithContext(context.Background(), listPolicyTemplateVersionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListPolicyTemplateVersionsWithContext is an alternate form of the ListPolicyTemplateVersions method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWithContext(ctx context.Context, listPolicyTemplateVersionsOptions *ListPolicyTemplateVersionsOptions) (result *PolicyTemplateVersionsCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPolicyTemplateVersionsOptions, "listPolicyTemplateVersionsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPolicyTemplateVersionsOptions, "listPolicyTemplateVersionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2029,6 +2268,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWith builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2048,17 +2288,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWith request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_policy_template_versions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateVersionsCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2070,23 +2314,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyTemplateVersionsWith // ReplacePolicyTemplate : Update a policy template version // Update a specific version of a policy template. You can use this only if the version isn't committed. func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplate(replacePolicyTemplateOptions *ReplacePolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ReplacePolicyTemplateWithContext(context.Background(), replacePolicyTemplateOptions) + result, response, err = iamPolicyManagement.ReplacePolicyTemplateWithContext(context.Background(), replacePolicyTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ReplacePolicyTemplateWithContext is an alternate form of the ReplacePolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithContext(ctx context.Context, replacePolicyTemplateOptions *ReplacePolicyTemplateOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(replacePolicyTemplateOptions, "replacePolicyTemplateOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(replacePolicyTemplateOptions, "replacePolicyTemplateOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ "policy_template_id": *replacePolicyTemplateOptions.PolicyTemplateID, - "version": *replacePolicyTemplateOptions.Version, + "version": *replacePolicyTemplateOptions.Version, } builder := core.NewRequestBuilder(core.PUT) @@ -2094,6 +2342,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithConte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2126,22 +2375,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithConte } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "replace_policy_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplate) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2155,23 +2409,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) ReplacePolicyTemplateWithConte // a policy template version that is assigned to one or more child accounts. You must remove the policy assignments // first. func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersion(deletePolicyTemplateVersionOptions *DeletePolicyTemplateVersionOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.DeletePolicyTemplateVersionWithContext(context.Background(), deletePolicyTemplateVersionOptions) + response, err = iamPolicyManagement.DeletePolicyTemplateVersionWithContext(context.Background(), deletePolicyTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeletePolicyTemplateVersionWithContext is an alternate form of the DeletePolicyTemplateVersion method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWithContext(ctx context.Context, deletePolicyTemplateVersionOptions *DeletePolicyTemplateVersionOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyTemplateVersionOptions, "deletePolicyTemplateVersionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyTemplateVersionOptions, "deletePolicyTemplateVersionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ "policy_template_id": *deletePolicyTemplateVersionOptions.PolicyTemplateID, - "version": *deletePolicyTemplateVersionOptions.Version, + "version": *deletePolicyTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.DELETE) @@ -2179,6 +2437,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWit builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2193,10 +2452,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWit request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_policy_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -2204,23 +2469,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyTemplateVersionWit // GetPolicyTemplateVersion : Retrieve a policy template version // Retrieve a policy template by providing a policy template ID and version number. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersion(getPolicyTemplateVersionOptions *GetPolicyTemplateVersionOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetPolicyTemplateVersionWithContext(context.Background(), getPolicyTemplateVersionOptions) + result, response, err = iamPolicyManagement.GetPolicyTemplateVersionWithContext(context.Background(), getPolicyTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetPolicyTemplateVersionWithContext is an alternate form of the GetPolicyTemplateVersion method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithContext(ctx context.Context, getPolicyTemplateVersionOptions *GetPolicyTemplateVersionOptions) (result *PolicyTemplate, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyTemplateVersionOptions, "getPolicyTemplateVersionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyTemplateVersionOptions, "getPolicyTemplateVersionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ "policy_template_id": *getPolicyTemplateVersionOptions.PolicyTemplateID, - "version": *getPolicyTemplateVersionOptions.Version, + "version": *getPolicyTemplateVersionOptions.Version, } builder := core.NewRequestBuilder(core.GET) @@ -2228,6 +2497,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithCo builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2243,17 +2513,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithCo request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_policy_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplate) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2266,23 +2540,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyTemplateVersionWithCo // Commit a policy template version. You can make no further changes to the policy template once it's committed. If you // need to make updates after committing a version, create a new version. func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplate(commitPolicyTemplateOptions *CommitPolicyTemplateOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.CommitPolicyTemplateWithContext(context.Background(), commitPolicyTemplateOptions) + response, err = iamPolicyManagement.CommitPolicyTemplateWithContext(context.Background(), commitPolicyTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CommitPolicyTemplateWithContext is an alternate form of the CommitPolicyTemplate method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContext(ctx context.Context, commitPolicyTemplateOptions *CommitPolicyTemplateOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(commitPolicyTemplateOptions, "commitPolicyTemplateOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(commitPolicyTemplateOptions, "commitPolicyTemplateOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ "policy_template_id": *commitPolicyTemplateOptions.PolicyTemplateID, - "version": *commitPolicyTemplateOptions.Version, + "version": *commitPolicyTemplateOptions.Version, } builder := core.NewRequestBuilder(core.POST) @@ -2290,6 +2568,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContex builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_templates/{policy_template_id}/versions/{version}/commit`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2304,10 +2583,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContex request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "commit_policy_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -2319,17 +2604,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CommitPolicyTemplateWithContex // that the caller has read access to are returned. If the caller does not have read access to any policy template // assignments an empty array is returned. func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignments(listPolicyAssignmentsOptions *ListPolicyAssignmentsOptions) (result *PolicyTemplateAssignmentCollection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.ListPolicyAssignmentsWithContext(context.Background(), listPolicyAssignmentsOptions) + result, response, err = iamPolicyManagement.ListPolicyAssignmentsWithContext(context.Background(), listPolicyAssignmentsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListPolicyAssignmentsWithContext is an alternate form of the ListPolicyAssignments method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithContext(ctx context.Context, listPolicyAssignmentsOptions *ListPolicyAssignmentsOptions) (result *PolicyTemplateAssignmentCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listPolicyAssignmentsOptions, "listPolicyAssignmentsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listPolicyAssignmentsOptions, "listPolicyAssignmentsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2338,6 +2627,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithConte builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2365,17 +2655,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithConte request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_policy_assignments", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateAssignmentCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2388,17 +2682,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) ListPolicyAssignmentsWithConte // Assign a policy template to child accounts and account groups. This creates the policy in the accounts and account // groups that you specify. func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment(createPolicyTemplateAssignmentOptions *CreatePolicyTemplateAssignmentOptions) (result *PolicyAssignmentV1Collection, response *core.DetailedResponse, err error) { - return iamPolicyManagement.CreatePolicyTemplateAssignmentWithContext(context.Background(), createPolicyTemplateAssignmentOptions) + result, response, err = iamPolicyManagement.CreatePolicyTemplateAssignmentWithContext(context.Background(), createPolicyTemplateAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreatePolicyTemplateAssignmentWithContext is an alternate form of the CreatePolicyTemplateAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignmentWithContext(ctx context.Context, createPolicyTemplateAssignmentOptions *CreatePolicyTemplateAssignmentOptions) (result *PolicyAssignmentV1Collection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createPolicyTemplateAssignmentOptions, "createPolicyTemplateAssignmentOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createPolicyTemplateAssignmentOptions, "createPolicyTemplateAssignmentOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2407,6 +2705,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2438,22 +2737,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_policy_template_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyAssignmentV1Collection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2465,17 +2769,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) CreatePolicyTemplateAssignment // GetPolicyAssignment : Retrieve a policy assignment // Retrieve a policy template assignment by providing a policy assignment ID. func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignment(getPolicyAssignmentOptions *GetPolicyAssignmentOptions) (result PolicyTemplateAssignmentItemsIntf, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetPolicyAssignmentWithContext(context.Background(), getPolicyAssignmentOptions) + result, response, err = iamPolicyManagement.GetPolicyAssignmentWithContext(context.Background(), getPolicyAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetPolicyAssignmentWithContext is an alternate form of the GetPolicyAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext(ctx context.Context, getPolicyAssignmentOptions *GetPolicyAssignmentOptions) (result PolicyTemplateAssignmentItemsIntf, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getPolicyAssignmentOptions, "getPolicyAssignmentOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getPolicyAssignmentOptions, "getPolicyAssignmentOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2488,6 +2796,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments/{assignment_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2505,17 +2814,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_policy_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyTemplateAssignmentItems) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2527,17 +2840,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetPolicyAssignmentWithContext // UpdatePolicyAssignment : Update a policy authorization type assignment // Update a policy assignment by providing a policy assignment ID. func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignment(updatePolicyAssignmentOptions *UpdatePolicyAssignmentOptions) (result *PolicyAssignmentV1, response *core.DetailedResponse, err error) { - return iamPolicyManagement.UpdatePolicyAssignmentWithContext(context.Background(), updatePolicyAssignmentOptions) + result, response, err = iamPolicyManagement.UpdatePolicyAssignmentWithContext(context.Background(), updatePolicyAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdatePolicyAssignmentWithContext is an alternate form of the UpdatePolicyAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithContext(ctx context.Context, updatePolicyAssignmentOptions *UpdatePolicyAssignmentOptions) (result *PolicyAssignmentV1, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updatePolicyAssignmentOptions, "updatePolicyAssignmentOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updatePolicyAssignmentOptions, "updatePolicyAssignmentOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2550,6 +2867,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithCont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments/{assignment_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2575,22 +2893,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithCont } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_policy_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPolicyAssignmentV1) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2603,17 +2926,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdatePolicyAssignmentWithCont // Remove a policy template assignment by providing a policy assignment ID. You can't delete a policy assignment if the // status is "in_progress". func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignment(deletePolicyAssignmentOptions *DeletePolicyAssignmentOptions) (response *core.DetailedResponse, err error) { - return iamPolicyManagement.DeletePolicyAssignmentWithContext(context.Background(), deletePolicyAssignmentOptions) + response, err = iamPolicyManagement.DeletePolicyAssignmentWithContext(context.Background(), deletePolicyAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeletePolicyAssignmentWithContext is an alternate form of the DeletePolicyAssignment method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithContext(ctx context.Context, deletePolicyAssignmentOptions *DeletePolicyAssignmentOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deletePolicyAssignmentOptions, "deletePolicyAssignmentOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deletePolicyAssignmentOptions, "deletePolicyAssignmentOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2626,6 +2953,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithCont builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/policy_assignments/{assignment_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2640,10 +2968,16 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithCont request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_policy_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -2651,17 +2985,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeletePolicyAssignmentWithCont // GetSettings : Retrieve Access Management account settings by account ID // Retrieve Access Management settings for an account by providing the account ID. func (iamPolicyManagement *IamPolicyManagementV1) GetSettings(getSettingsOptions *GetSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { - return iamPolicyManagement.GetSettingsWithContext(context.Background(), getSettingsOptions) + result, response, err = iamPolicyManagement.GetSettingsWithContext(context.Background(), getSettingsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetSettingsWithContext is an alternate form of the GetSettings method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) GetSettingsWithContext(ctx context.Context, getSettingsOptions *GetSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getSettingsOptions, "getSettingsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getSettingsOptions, "getSettingsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2674,6 +3012,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetSettingsWithContext(ctx con builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/accounts/{account_id}/settings/access_management`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2692,17 +3031,21 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetSettingsWithContext(ctx con request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_settings", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettingsAccessManagement) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2721,36 +3064,40 @@ func (iamPolicyManagement *IamPolicyManagementV1) GetSettingsWithContext(ctx con // * the external account ID(s) and state for the specific identity in the request body // // External account identity interaction includes the following `identity_types`: `user` (user identities defined as -// [IBMid’s](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#users-bestpract)), `service_id` +// [IBMid's](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#users-bestpract)), `service_id` // (defined as [IAM // ServiceIds](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#serviceid-bestpract)), `service` // (defined by a service’s [CRN](https://test.cloud.ibm.com/docs/account?topic=account-crn)). To update an Identity’s // setting, the `state` and `external_allowed_accounts` fields are required. // // Different identity states are: -// "enabled": An identity type is allowed to access resources in the account provided it has access policies on those +// * "enabled": An identity type is allowed to access resources in the account provided it has access policies on those // resources. -// "limited": An identity type is allowed to access resources in the account provided it has access policies on those +// * "limited": An identity type is allowed to access resources in the account provided it has access policies on those // resources AND it is associated with either the account the resources are in or one of the allowed accounts. This // setting leverages the "external_allowed_accounts" list. -// "monitor": Has no direct impact on an Identity’s access. Instead, it creates AT events for access decisions as if the -// account were in a limited “state”. +// * "monitor": Has no direct impact on an Identity’s access. Instead, it creates AT events for access decisions as if +// the account were in a limited “state”. // // **Note**: The state "enabled" is a special case. In this case, access is given to all accounts and there is no need // to specify a particular list. Therefore, when updating "state" to "enabled" for an identity type // "external_allowed_accounts" should be left empty. func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettings(updateSettingsOptions *UpdateSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { - return iamPolicyManagement.UpdateSettingsWithContext(context.Background(), updateSettingsOptions) + result, response, err = iamPolicyManagement.UpdateSettingsWithContext(context.Background(), updateSettingsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateSettingsWithContext is an alternate form of the UpdateSettings method which supports a Context parameter func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettingsWithContext(ctx context.Context, updateSettingsOptions *UpdateSettingsOptions) (result *AccountSettingsAccessManagement, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateSettingsOptions, "updateSettingsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateSettingsOptions, "updateSettingsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2763,6 +3110,7 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettingsWithContext(ctx builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/accounts/{account_id}/settings/access_management`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -2789,22 +3137,27 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettingsWithContext(ctx } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_settings", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAccountSettingsAccessManagement) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2812,6 +3165,9 @@ func (iamPolicyManagement *IamPolicyManagementV1) UpdateSettingsWithContext(ctx return } +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "1.0.1") +} // AccountSettingsAccessManagement : The Access Management Account Settings that are currently set for the requested account. type AccountSettingsAccessManagement struct { @@ -2824,6 +3180,7 @@ func UnmarshalAccountSettingsAccessManagement(m map[string]json.RawMessage, resu obj := new(AccountSettingsAccessManagement) err = core.UnmarshalModel(m, "external_account_identity_interaction", &obj.ExternalAccountIdentityInteraction, UnmarshalExternalAccountIdentityInteraction) if err != nil { + err = core.SDKErrorf(err, "", "external_account_identity_interaction-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -2841,6 +3198,7 @@ func UnmarshalAssignmentResourceCreated(m map[string]json.RawMessage, result int obj := new(AssignmentResourceCreated) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -2867,10 +3225,12 @@ func UnmarshalAssignmentTargetDetails(m map[string]json.RawMessage, result inter obj := new(AssignmentTargetDetails) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -2891,10 +3251,12 @@ func UnmarshalAssignmentTemplateDetails(m map[string]json.RawMessage, result int obj := new(AssignmentTemplateDetails) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -2917,7 +3279,7 @@ type CommitPolicyTemplateOptions struct { func (*IamPolicyManagementV1) NewCommitPolicyTemplateOptions(policyTemplateID string, version string) *CommitPolicyTemplateOptions { return &CommitPolicyTemplateOptions{ PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -2956,14 +3318,17 @@ func UnmarshalConflictsWith(m map[string]json.RawMessage, result interface{}) (e obj := new(ConflictsWith) err = core.UnmarshalPrimitive(m, "etag", &obj.Etag) if err != nil { + err = core.SDKErrorf(err, "", "etag-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "role", &obj.Role) if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -2982,6 +3347,9 @@ func (*IamPolicyManagementV1) NewControl(grant *Grant) (_model *Control, err err Grant: grant, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -2990,6 +3358,7 @@ func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err err obj := new(Control) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3004,6 +3373,7 @@ type ControlResponse struct { // Permission granted by the policy. Grant *Grant `json:"grant,omitempty"` } + func (*ControlResponse) isaControlResponse() bool { return true } @@ -3017,6 +3387,7 @@ func UnmarshalControlResponse(m map[string]json.RawMessage, result interface{}) obj := new(ControlResponse) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3061,9 +3432,9 @@ type CreatePolicyOptions struct { // NewCreatePolicyOptions : Instantiate CreatePolicyOptions func (*IamPolicyManagementV1) NewCreatePolicyOptions(typeVar string, subjects []PolicySubject, roles []PolicyRole, resources []PolicyResource) *CreatePolicyOptions { return &CreatePolicyOptions{ - Type: core.StringPtr(typeVar), - Subjects: subjects, - Roles: roles, + Type: core.StringPtr(typeVar), + Subjects: subjects, + Roles: roles, Resources: resources, } } @@ -3145,9 +3516,9 @@ type CreatePolicyTemplateAssignmentOptions struct { // NewCreatePolicyTemplateAssignmentOptions : Instantiate CreatePolicyTemplateAssignmentOptions func (*IamPolicyManagementV1) NewCreatePolicyTemplateAssignmentOptions(version string, target *AssignmentTargetDetails, options *PolicyAssignmentV1Options, templates []AssignmentTemplateDetails) *CreatePolicyTemplateAssignmentOptions { return &CreatePolicyTemplateAssignmentOptions{ - Version: core.StringPtr(version), - Target: target, - Options: options, + Version: core.StringPtr(version), + Target: target, + Options: options, Templates: templates, } } @@ -3228,9 +3599,9 @@ type CreatePolicyTemplateOptions struct { // NewCreatePolicyTemplateOptions : Instantiate CreatePolicyTemplateOptions func (*IamPolicyManagementV1) NewCreatePolicyTemplateOptions(name string, accountID string, policy *TemplatePolicy) *CreatePolicyTemplateOptions { return &CreatePolicyTemplateOptions{ - Name: core.StringPtr(name), + Name: core.StringPtr(name), AccountID: core.StringPtr(accountID), - Policy: policy, + Policy: policy, } } @@ -3303,7 +3674,7 @@ type CreatePolicyTemplateVersionOptions struct { func (*IamPolicyManagementV1) NewCreatePolicyTemplateVersionOptions(policyTemplateID string, policy *TemplatePolicy) *CreatePolicyTemplateVersionOptions { return &CreatePolicyTemplateVersionOptions{ PolicyTemplateID: core.StringPtr(policyTemplateID), - Policy: policy, + Policy: policy, } } @@ -3386,9 +3757,9 @@ type CreateRoleOptions struct { func (*IamPolicyManagementV1) NewCreateRoleOptions(displayName string, actions []string, name string, accountID string, serviceName string) *CreateRoleOptions { return &CreateRoleOptions{ DisplayName: core.StringPtr(displayName), - Actions: actions, - Name: core.StringPtr(name), - AccountID: core.StringPtr(accountID), + Actions: actions, + Name: core.StringPtr(name), + AccountID: core.StringPtr(accountID), ServiceName: core.StringPtr(serviceName), } } @@ -3486,7 +3857,7 @@ type CreateV2PolicyOptions struct { // Constants associated with the CreateV2PolicyOptions.Type property. // The policy type; either 'access' or 'authorization'. const ( - CreateV2PolicyOptionsTypeAccessConst = "access" + CreateV2PolicyOptionsTypeAccessConst = "access" CreateV2PolicyOptionsTypeAuthorizationConst = "authorization" ) @@ -3494,7 +3865,7 @@ const ( func (*IamPolicyManagementV1) NewCreateV2PolicyOptions(control *Control, typeVar string) *CreateV2PolicyOptions { return &CreateV2PolicyOptions{ Control: control, - Type: core.StringPtr(typeVar), + Type: core.StringPtr(typeVar), } } @@ -3601,54 +3972,67 @@ func UnmarshalCustomRole(m map[string]json.RawMessage, result interface{}) (err obj := new(CustomRole) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { + err = core.SDKErrorf(err, "", "crn-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, "account_id", &obj.AccountID) if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "service_name", &obj.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "service_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3755,7 +4139,7 @@ type DeletePolicyTemplateVersionOptions struct { func (*IamPolicyManagementV1) NewDeletePolicyTemplateVersionOptions(policyTemplateID string, version string) *DeletePolicyTemplateVersionOptions { return &DeletePolicyTemplateVersionOptions{ PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -3855,18 +4239,22 @@ func UnmarshalEnrichedRoles(m map[string]json.RawMessage, result interface{}) (e obj := new(EnrichedRoles) err = core.UnmarshalPrimitive(m, "role_id", &obj.RoleID) if err != nil { + err = core.SDKErrorf(err, "", "role_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "actions", &obj.Actions, UnmarshalRoleAction) if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3884,6 +4272,7 @@ func UnmarshalErrorDetails(m map[string]json.RawMessage, result interface{}) (er obj := new(ErrorDetails) err = core.UnmarshalModel(m, "conflicts_with", &obj.ConflictsWith, UnmarshalConflictsWith) if err != nil { + err = core.SDKErrorf(err, "", "conflicts_with-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3908,24 +4297,24 @@ type ErrorObject struct { // Constants associated with the ErrorObject.Code property. // The API error code for the error. const ( - ErrorObjectCodeInsufficentPermissionsConst = "insufficent_permissions" - ErrorObjectCodeInvalidBodyConst = "invalid_body" - ErrorObjectCodeInvalidTokenConst = "invalid_token" + ErrorObjectCodeInsufficentPermissionsConst = "insufficent_permissions" + ErrorObjectCodeInvalidBodyConst = "invalid_body" + ErrorObjectCodeInvalidTokenConst = "invalid_token" ErrorObjectCodeMissingRequiredQueryParameterConst = "missing_required_query_parameter" - ErrorObjectCodeNotFoundConst = "not_found" + ErrorObjectCodeNotFoundConst = "not_found" ErrorObjectCodePolicyAssignmentConflictErrorConst = "policy_assignment_conflict_error" - ErrorObjectCodePolicyAssignmentNotFoundConst = "policy_assignment_not_found" - ErrorObjectCodePolicyConflictErrorConst = "policy_conflict_error" - ErrorObjectCodePolicyNotFoundConst = "policy_not_found" - ErrorObjectCodePolicyTemplateConflictErrorConst = "policy_template_conflict_error" - ErrorObjectCodePolicyTemplateNotFoundConst = "policy_template_not_found" - ErrorObjectCodeRequestNotProcessedConst = "request_not_processed" - ErrorObjectCodeResourceNotFoundConst = "resource_not_found" - ErrorObjectCodeRoleConflictErrorConst = "role_conflict_error" - ErrorObjectCodeRoleNotFoundConst = "role_not_found" - ErrorObjectCodeTooManyRequestsConst = "too_many_requests" - ErrorObjectCodeUnableToProcessConst = "unable_to_process" - ErrorObjectCodeUnsupportedContentTypeConst = "unsupported_content_type" + ErrorObjectCodePolicyAssignmentNotFoundConst = "policy_assignment_not_found" + ErrorObjectCodePolicyConflictErrorConst = "policy_conflict_error" + ErrorObjectCodePolicyNotFoundConst = "policy_not_found" + ErrorObjectCodePolicyTemplateConflictErrorConst = "policy_template_conflict_error" + ErrorObjectCodePolicyTemplateNotFoundConst = "policy_template_not_found" + ErrorObjectCodeRequestNotProcessedConst = "request_not_processed" + ErrorObjectCodeResourceNotFoundConst = "resource_not_found" + ErrorObjectCodeRoleConflictErrorConst = "role_conflict_error" + ErrorObjectCodeRoleNotFoundConst = "role_not_found" + ErrorObjectCodeTooManyRequestsConst = "too_many_requests" + ErrorObjectCodeUnableToProcessConst = "unable_to_process" + ErrorObjectCodeUnsupportedContentTypeConst = "unsupported_content_type" ) // UnmarshalErrorObject unmarshals an instance of ErrorObject from the specified map of raw messages. @@ -3933,18 +4322,22 @@ func UnmarshalErrorObject(m map[string]json.RawMessage, result interface{}) (err obj := new(ErrorObject) err = core.UnmarshalPrimitive(m, "code", &obj.Code) if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "message", &obj.Message) if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "details", &obj.Details, UnmarshalErrorDetails) if err != nil { + err = core.SDKErrorf(err, "", "details-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3968,14 +4361,17 @@ func UnmarshalErrorResponse(m map[string]json.RawMessage, result interface{}) (e obj := new(ErrorResponse) err = core.UnmarshalPrimitive(m, "trace", &obj.Trace) if err != nil { + err = core.SDKErrorf(err, "", "trace-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalErrorObject) if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status_code", &obj.StatusCode) if err != nil { + err = core.SDKErrorf(err, "", "status_code-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3993,6 +4389,7 @@ func UnmarshalExternalAccountIdentityInteraction(m map[string]json.RawMessage, r obj := new(ExternalAccountIdentityInteraction) err = core.UnmarshalModel(m, "identity_types", &obj.IdentityTypes, UnmarshalIdentityTypes) if err != nil { + err = core.SDKErrorf(err, "", "identity_types-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4010,6 +4407,7 @@ func UnmarshalExternalAccountIdentityInteractionPatch(m map[string]json.RawMessa obj := new(ExternalAccountIdentityInteractionPatch) err = core.UnmarshalModel(m, "identity_types", &obj.IdentityTypes, UnmarshalIdentityTypesPatch) if err != nil { + err = core.SDKErrorf(err, "", "identity_types-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4032,7 +4430,7 @@ type GetPolicyAssignmentOptions struct { func (*IamPolicyManagementV1) NewGetPolicyAssignmentOptions(assignmentID string, version string) *GetPolicyAssignmentOptions { return &GetPolicyAssignmentOptions{ AssignmentID: core.StringPtr(assignmentID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -4097,7 +4495,7 @@ type GetPolicyTemplateOptions struct { // Constants associated with the GetPolicyTemplateOptions.State property. // The policy template state. const ( - GetPolicyTemplateOptionsStateActiveConst = "active" + GetPolicyTemplateOptionsStateActiveConst = "active" GetPolicyTemplateOptionsStateDeletedConst = "deleted" ) @@ -4142,7 +4540,7 @@ type GetPolicyTemplateVersionOptions struct { func (*IamPolicyManagementV1) NewGetPolicyTemplateVersionOptions(policyTemplateID string, version string) *GetPolicyTemplateVersionOptions { return &GetPolicyTemplateVersionOptions{ PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), + Version: core.StringPtr(version), } } @@ -4263,7 +4661,7 @@ type GetV2PolicyOptions struct { // * `display` - returns the list of all actions included in each of the policy roles and translations for all relevant // fields. const ( - GetV2PolicyOptionsFormatDisplayConst = "display" + GetV2PolicyOptionsFormatDisplayConst = "display" GetV2PolicyOptionsFormatIncludeLastPermitConst = "include_last_permit" ) @@ -4304,6 +4702,9 @@ func (*IamPolicyManagementV1) NewGrant(roles []Roles) (_model *Grant, err error) Roles: roles, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -4312,6 +4713,7 @@ func UnmarshalGrant(m map[string]json.RawMessage, result interface{}) (err error obj := new(Grant) err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalRoles) if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4329,6 +4731,7 @@ func UnmarshalGrantWithEnrichedRoles(m map[string]json.RawMessage, result interf obj := new(GrantWithEnrichedRoles) err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalEnrichedRoles) if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4352,14 +4755,17 @@ func UnmarshalIdentityTypes(m map[string]json.RawMessage, result interface{}) (e obj := new(IdentityTypes) err = core.UnmarshalModel(m, "user", &obj.User, UnmarshalIdentityTypesBase) if err != nil { + err = core.SDKErrorf(err, "", "user-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "service_id", &obj.ServiceID, UnmarshalIdentityTypesBase) if err != nil { + err = core.SDKErrorf(err, "", "service_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "service", &obj.Service, UnmarshalIdentityTypesBase) if err != nil { + err = core.SDKErrorf(err, "", "service-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4386,10 +4792,13 @@ const ( // NewIdentityTypesBase : Instantiate IdentityTypesBase (Generic Model Constructor) func (*IamPolicyManagementV1) NewIdentityTypesBase(state string, externalAllowedAccounts []string) (_model *IdentityTypesBase, err error) { _model = &IdentityTypesBase{ - State: core.StringPtr(state), + State: core.StringPtr(state), ExternalAllowedAccounts: externalAllowedAccounts, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -4398,10 +4807,12 @@ func UnmarshalIdentityTypesBase(m map[string]json.RawMessage, result interface{} obj := new(IdentityTypesBase) err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "external_allowed_accounts", &obj.ExternalAllowedAccounts) if err != nil { + err = core.SDKErrorf(err, "", "external_allowed_accounts-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4425,14 +4836,17 @@ func UnmarshalIdentityTypesPatch(m map[string]json.RawMessage, result interface{ obj := new(IdentityTypesPatch) err = core.UnmarshalModel(m, "user", &obj.User, UnmarshalIdentityTypesBase) if err != nil { + err = core.SDKErrorf(err, "", "user-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "service_id", &obj.ServiceID, UnmarshalIdentityTypesBase) if err != nil { + err = core.SDKErrorf(err, "", "service_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "service", &obj.Service, UnmarshalIdentityTypesBase) if err != nil { + err = core.SDKErrorf(err, "", "service-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4453,10 +4867,12 @@ func UnmarshalLimitData(m map[string]json.RawMessage, result interface{}) (err e obj := new(LimitData) err = core.UnmarshalPrimitive(m, "current", &obj.Current) if err != nil { + err = core.SDKErrorf(err, "", "current-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4522,7 +4938,7 @@ type ListPoliciesOptions struct { // Constants associated with the ListPoliciesOptions.Type property. // Optional type of policy. const ( - ListPoliciesOptionsTypeAccessConst = "access" + ListPoliciesOptionsTypeAccessConst = "access" ListPoliciesOptionsTypeAuthorizationConst = "authorization" ) @@ -4530,21 +4946,21 @@ const ( // Optional type of service. const ( ListPoliciesOptionsServiceTypePlatformServiceConst = "platform_service" - ListPoliciesOptionsServiceTypeServiceConst = "service" + ListPoliciesOptionsServiceTypeServiceConst = "service" ) // Constants associated with the ListPoliciesOptions.Sort property. // Optional top level policy field to sort results. Ascending sort is default. Descending sort available by prepending // '-' to field. Example '-last_modified_at'. const ( - ListPoliciesOptionsSortCreatedAtConst = "created_at" - ListPoliciesOptionsSortCreatedByIDConst = "created_by_id" - ListPoliciesOptionsSortHrefConst = "href" - ListPoliciesOptionsSortIDConst = "id" - ListPoliciesOptionsSortLastModifiedAtConst = "last_modified_at" + ListPoliciesOptionsSortCreatedAtConst = "created_at" + ListPoliciesOptionsSortCreatedByIDConst = "created_by_id" + ListPoliciesOptionsSortHrefConst = "href" + ListPoliciesOptionsSortIDConst = "id" + ListPoliciesOptionsSortLastModifiedAtConst = "last_modified_at" ListPoliciesOptionsSortLastModifiedByIDConst = "last_modified_by_id" - ListPoliciesOptionsSortStateConst = "state" - ListPoliciesOptionsSortTypeConst = "type" + ListPoliciesOptionsSortStateConst = "state" + ListPoliciesOptionsSortTypeConst = "type" ) // Constants associated with the ListPoliciesOptions.Format property. @@ -4553,7 +4969,7 @@ const ( // it has done so // * `display` - returns the list of all actions included in each of the policy roles. const ( - ListPoliciesOptionsFormatDisplayConst = "display" + ListPoliciesOptionsFormatDisplayConst = "display" ListPoliciesOptionsFormatIncludeLastPermitConst = "include_last_permit" ) @@ -4562,7 +4978,7 @@ const ( // * `active` - returns active policies // * `deleted` - returns non-active policies. const ( - ListPoliciesOptionsStateActiveConst = "active" + ListPoliciesOptionsStateActiveConst = "active" ListPoliciesOptionsStateDeletedConst = "deleted" ) @@ -4680,7 +5096,7 @@ type ListPolicyAssignmentsOptions struct { // NewListPolicyAssignmentsOptions : Instantiate ListPolicyAssignmentsOptions func (*IamPolicyManagementV1) NewListPolicyAssignmentsOptions(version string, accountID string) *ListPolicyAssignmentsOptions { return &ListPolicyAssignmentsOptions{ - Version: core.StringPtr(version), + Version: core.StringPtr(version), AccountID: core.StringPtr(accountID), } } @@ -4736,7 +5152,7 @@ type ListPolicyTemplateVersionsOptions struct { // Constants associated with the ListPolicyTemplateVersionsOptions.State property. // The policy template state. const ( - ListPolicyTemplateVersionsOptionsStateActiveConst = "active" + ListPolicyTemplateVersionsOptionsStateActiveConst = "active" ListPolicyTemplateVersionsOptionsStateDeletedConst = "deleted" ) @@ -4809,7 +5225,7 @@ type ListPolicyTemplatesOptions struct { // Constants associated with the ListPolicyTemplatesOptions.State property. // The policy template state. const ( - ListPolicyTemplatesOptionsStateActiveConst = "active" + ListPolicyTemplatesOptionsStateActiveConst = "active" ListPolicyTemplatesOptionsStateDeletedConst = "deleted" ) @@ -4817,13 +5233,13 @@ const ( // Service type, Optional. const ( ListPolicyTemplatesOptionsPolicyServiceTypePlatformServiceConst = "platform_service" - ListPolicyTemplatesOptionsPolicyServiceTypeServiceConst = "service" + ListPolicyTemplatesOptionsPolicyServiceTypeServiceConst = "service" ) // Constants associated with the ListPolicyTemplatesOptions.PolicyType property. // Policy type, Optional. const ( - ListPolicyTemplatesOptionsPolicyTypeAccessConst = "access" + ListPolicyTemplatesOptionsPolicyTypeAccessConst = "access" ListPolicyTemplatesOptionsPolicyTypeAuthorizationConst = "authorization" ) @@ -5042,7 +5458,7 @@ type ListV2PoliciesOptions struct { // Constants associated with the ListV2PoliciesOptions.Type property. // Optional type of policy. const ( - ListV2PoliciesOptionsTypeAccessConst = "access" + ListV2PoliciesOptionsTypeAccessConst = "access" ListV2PoliciesOptionsTypeAuthorizationConst = "authorization" ) @@ -5050,7 +5466,7 @@ const ( // Optional type of service. const ( ListV2PoliciesOptionsServiceTypePlatformServiceConst = "platform_service" - ListV2PoliciesOptionsServiceTypeServiceConst = "service" + ListV2PoliciesOptionsServiceTypeServiceConst = "service" ) // Constants associated with the ListV2PoliciesOptions.Format property. @@ -5060,7 +5476,7 @@ const ( // * `display` - returns the list of all actions included in each of the policy roles and translations for all relevant // fields. const ( - ListV2PoliciesOptionsFormatDisplayConst = "display" + ListV2PoliciesOptionsFormatDisplayConst = "display" ListV2PoliciesOptionsFormatIncludeLastPermitConst = "include_last_permit" ) @@ -5069,7 +5485,7 @@ const ( // * `active` - returns active policies // * `deleted` - returns non-active policies. const ( - ListV2PoliciesOptionsStateActiveConst = "active" + ListV2PoliciesOptionsStateActiveConst = "active" ListV2PoliciesOptionsStateDeletedConst = "deleted" ) @@ -5175,26 +5591,27 @@ type NestedCondition struct { // Constants associated with the NestedCondition.Operator property. // The operator of an attribute. const ( - NestedConditionOperatorDategreaterthanConst = "dateGreaterThan" - NestedConditionOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" - NestedConditionOperatorDatelessthanConst = "dateLessThan" - NestedConditionOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" - NestedConditionOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" + NestedConditionOperatorDategreaterthanConst = "dateGreaterThan" + NestedConditionOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" + NestedConditionOperatorDatelessthanConst = "dateLessThan" + NestedConditionOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" + NestedConditionOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" NestedConditionOperatorDatetimegreaterthanorequalsConst = "dateTimeGreaterThanOrEquals" - NestedConditionOperatorDatetimelessthanConst = "dateTimeLessThan" - NestedConditionOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" - NestedConditionOperatorDayofweekanyofConst = "dayOfWeekAnyOf" - NestedConditionOperatorDayofweekequalsConst = "dayOfWeekEquals" - NestedConditionOperatorStringequalsConst = "stringEquals" - NestedConditionOperatorStringequalsanyofConst = "stringEqualsAnyOf" - NestedConditionOperatorStringexistsConst = "stringExists" - NestedConditionOperatorStringmatchConst = "stringMatch" - NestedConditionOperatorStringmatchanyofConst = "stringMatchAnyOf" - NestedConditionOperatorTimegreaterthanConst = "timeGreaterThan" - NestedConditionOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" - NestedConditionOperatorTimelessthanConst = "timeLessThan" - NestedConditionOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" + NestedConditionOperatorDatetimelessthanConst = "dateTimeLessThan" + NestedConditionOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" + NestedConditionOperatorDayofweekanyofConst = "dayOfWeekAnyOf" + NestedConditionOperatorDayofweekequalsConst = "dayOfWeekEquals" + NestedConditionOperatorStringequalsConst = "stringEquals" + NestedConditionOperatorStringequalsanyofConst = "stringEqualsAnyOf" + NestedConditionOperatorStringexistsConst = "stringExists" + NestedConditionOperatorStringmatchConst = "stringMatch" + NestedConditionOperatorStringmatchanyofConst = "stringMatchAnyOf" + NestedConditionOperatorTimegreaterthanConst = "timeGreaterThan" + NestedConditionOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" + NestedConditionOperatorTimelessthanConst = "timeLessThan" + NestedConditionOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" ) + func (*NestedCondition) isaNestedCondition() bool { return true } @@ -5208,18 +5625,22 @@ func UnmarshalNestedCondition(m map[string]json.RawMessage, result interface{}) obj := new(NestedCondition) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalRuleAttribute) if err != nil { + err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5268,7 +5689,7 @@ type Policy struct { // Constants associated with the Policy.State property. // The policy state. const ( - PolicyStateActiveConst = "active" + PolicyStateActiveConst = "active" PolicyStateDeletedConst = "deleted" ) @@ -5277,50 +5698,62 @@ func UnmarshalPolicy(m map[string]json.RawMessage, result interface{}) (err erro obj := new(Policy) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) if err != nil { + err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5349,7 +5782,7 @@ type PolicyAssignmentOptions struct { // The policy subject type; either 'iam_id' or 'access_group_id'. const ( PolicyAssignmentOptionsSubjectTypeAccessGroupIDConst = "access_group_id" - PolicyAssignmentOptionsSubjectTypeIamIDConst = "iam_id" + PolicyAssignmentOptionsSubjectTypeIamIDConst = "iam_id" ) // UnmarshalPolicyAssignmentOptions unmarshals an instance of PolicyAssignmentOptions from the specified map of raw messages. @@ -5357,22 +5790,27 @@ func UnmarshalPolicyAssignmentOptions(m map[string]json.RawMessage, result inter obj := new(PolicyAssignmentOptions) err = core.UnmarshalPrimitive(m, "subject_type", &obj.SubjectType) if err != nil { + err = core.SDKErrorf(err, "", "subject_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "subject_id", &obj.SubjectID) if err != nil { + err = core.SDKErrorf(err, "", "subject_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_requester_id", &obj.RootRequesterID) if err != nil { + err = core.SDKErrorf(err, "", "root_requester_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_template_id", &obj.RootTemplateID) if err != nil { + err = core.SDKErrorf(err, "", "root_template_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_template_version", &obj.RootTemplateVersion) if err != nil { + err = core.SDKErrorf(err, "", "root_template_version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5396,14 +5834,17 @@ func UnmarshalPolicyAssignmentResourcePolicy(m map[string]json.RawMessage, resul obj := new(PolicyAssignmentResourcePolicy) err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalAssignmentResourceCreated) if err != nil { + err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalErrorResponse) if err != nil { + err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5424,10 +5865,12 @@ func UnmarshalPolicyAssignmentResources(m map[string]json.RawMessage, result int obj := new(PolicyAssignmentResources) err = core.UnmarshalPrimitive(m, "target", &obj.Target) if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalPolicyAssignmentResourcePolicy) if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5479,10 +5922,10 @@ type PolicyAssignmentV1 struct { // Constants associated with the PolicyAssignmentV1.Status property. // The policy assignment status. const ( - PolicyAssignmentV1StatusFailedConst = "failed" - PolicyAssignmentV1StatusInProgressConst = "in_progress" + PolicyAssignmentV1StatusFailedConst = "failed" + PolicyAssignmentV1StatusInProgressConst = "in_progress" PolicyAssignmentV1StatusSucceedWithErrorsConst = "succeed_with_errors" - PolicyAssignmentV1StatusSucceededConst = "succeeded" + PolicyAssignmentV1StatusSucceededConst = "succeeded" ) // UnmarshalPolicyAssignmentV1 unmarshals an instance of PolicyAssignmentV1 from the specified map of raw messages. @@ -5490,54 +5933,67 @@ func UnmarshalPolicyAssignmentV1(m map[string]json.RawMessage, result interface{ obj := new(PolicyAssignmentV1) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) if err != nil { + err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5555,6 +6011,7 @@ func UnmarshalPolicyAssignmentV1Collection(m map[string]json.RawMessage, result obj := new(PolicyAssignmentV1Collection) err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalPolicyAssignmentV1) if err != nil { + err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5573,6 +6030,9 @@ func (*IamPolicyManagementV1) NewPolicyAssignmentV1Options(root *PolicyAssignmen Root: root, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -5581,6 +6041,7 @@ func UnmarshalPolicyAssignmentV1Options(m map[string]json.RawMessage, result int obj := new(PolicyAssignmentV1Options) err = core.UnmarshalModel(m, "root", &obj.Root, UnmarshalPolicyAssignmentV1OptionsRoot) if err != nil { + err = core.SDKErrorf(err, "", "root-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5604,14 +6065,17 @@ func UnmarshalPolicyAssignmentV1OptionsRoot(m map[string]json.RawMessage, result obj := new(PolicyAssignmentV1OptionsRoot) err = core.UnmarshalPrimitive(m, "requester_id", &obj.RequesterID) if err != nil { + err = core.SDKErrorf(err, "", "requester_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "assignment_id", &obj.AssignmentID) if err != nil { + err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalPolicyAssignmentV1OptionsRootTemplate) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5632,10 +6096,12 @@ func UnmarshalPolicyAssignmentV1OptionsRootTemplate(m map[string]json.RawMessage obj := new(PolicyAssignmentV1OptionsRootTemplate) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5656,10 +6122,12 @@ func UnmarshalPolicyAssignmentV1Resources(m map[string]json.RawMessage, result i obj := new(PolicyAssignmentV1Resources) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalPolicyAssignmentResourcePolicy) if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5679,7 +6147,7 @@ type PolicyAssignmentV1Subject struct { // The identity type of the subject of the assignment. const ( PolicyAssignmentV1SubjectTypeAccessGroupIDConst = "access_group_id" - PolicyAssignmentV1SubjectTypeIamIDConst = "iam_id" + PolicyAssignmentV1SubjectTypeIamIDConst = "iam_id" ) // UnmarshalPolicyAssignmentV1Subject unmarshals an instance of PolicyAssignmentV1Subject from the specified map of raw messages. @@ -5687,10 +6155,12 @@ func UnmarshalPolicyAssignmentV1Subject(m map[string]json.RawMessage, result int obj := new(PolicyAssignmentV1Subject) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5708,6 +6178,7 @@ func UnmarshalPolicyCollection(m map[string]json.RawMessage, result interface{}) obj := new(PolicyCollection) err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalPolicyTemplateMetaData) if err != nil { + err = core.SDKErrorf(err, "", "policies-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5728,10 +6199,12 @@ func UnmarshalPolicyResource(m map[string]json.RawMessage, result interface{}) ( obj := new(PolicyResource) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalResourceAttribute) if err != nil { + err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tags", &obj.Tags, UnmarshalResourceTag) if err != nil { + err = core.SDKErrorf(err, "", "tags-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5756,6 +6229,9 @@ func (*IamPolicyManagementV1) NewPolicyRole(roleID string) (_model *PolicyRole, RoleID: core.StringPtr(roleID), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -5764,14 +6240,17 @@ func UnmarshalPolicyRole(m map[string]json.RawMessage, result interface{}) (err obj := new(PolicyRole) err = core.UnmarshalPrimitive(m, "role_id", &obj.RoleID) if err != nil { + err = core.SDKErrorf(err, "", "role_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-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)) @@ -5789,6 +6268,7 @@ func UnmarshalPolicySubject(m map[string]json.RawMessage, result interface{}) (e obj := new(PolicySubject) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalSubjectAttribute) if err != nil { + err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5842,7 +6322,7 @@ type PolicyTemplate struct { // Constants associated with the PolicyTemplate.State property. // State of policy template. const ( - PolicyTemplateStateActiveConst = "active" + PolicyTemplateStateActiveConst = "active" PolicyTemplateStateDeletedConst = "deleted" ) @@ -5851,54 +6331,67 @@ func UnmarshalPolicyTemplate(m map[string]json.RawMessage, result interface{}) ( obj := new(PolicyTemplate) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-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.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) if err != nil { + err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalTemplatePolicy) if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5916,6 +6409,7 @@ func UnmarshalPolicyTemplateAssignmentCollection(m map[string]json.RawMessage, r obj := new(PolicyTemplateAssignmentCollection) err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalPolicyTemplateAssignmentItems) if err != nil { + err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5982,10 +6476,10 @@ type PolicyTemplateAssignmentItems struct { // Constants associated with the PolicyTemplateAssignmentItems.Status property. // The policy assignment status. const ( - PolicyTemplateAssignmentItemsStatusFailedConst = "failed" - PolicyTemplateAssignmentItemsStatusInProgressConst = "in_progress" + PolicyTemplateAssignmentItemsStatusFailedConst = "failed" + PolicyTemplateAssignmentItemsStatusInProgressConst = "in_progress" PolicyTemplateAssignmentItemsStatusSucceedWithErrorsConst = "succeed_with_errors" - PolicyTemplateAssignmentItemsStatusSucceededConst = "succeeded" + PolicyTemplateAssignmentItemsStatusSucceededConst = "succeeded" ) // Constants associated with the PolicyTemplateAssignmentItems.TargetType property. @@ -5993,6 +6487,7 @@ const ( const ( PolicyTemplateAssignmentItemsTargetTypeAccountConst = "Account" ) + func (*PolicyTemplateAssignmentItems) isaPolicyTemplateAssignmentItems() bool { return true } @@ -6006,70 +6501,87 @@ func UnmarshalPolicyTemplateAssignmentItems(m map[string]json.RawMessage, result obj := new(PolicyTemplateAssignmentItems) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) if err != nil { + err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } 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, "assignment_id", &obj.AssignmentID) if err != nil { + err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "target_type", &obj.TargetType) if err != nil { + err = core.SDKErrorf(err, "", "target_type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6087,6 +6599,7 @@ func UnmarshalPolicyTemplateCollection(m map[string]json.RawMessage, result inte obj := new(PolicyTemplateCollection) err = core.UnmarshalModel(m, "policy_templates", &obj.PolicyTemplates, UnmarshalPolicyTemplate) if err != nil { + err = core.SDKErrorf(err, "", "policy_templates-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6143,7 +6656,7 @@ type PolicyTemplateLimitData struct { // Constants associated with the PolicyTemplateLimitData.State property. // State of policy template. const ( - PolicyTemplateLimitDataStateActiveConst = "active" + PolicyTemplateLimitDataStateActiveConst = "active" PolicyTemplateLimitDataStateDeletedConst = "deleted" ) @@ -6152,58 +6665,72 @@ func UnmarshalPolicyTemplateLimitData(m map[string]json.RawMessage, result inter obj := new(PolicyTemplateLimitData) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-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.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) if err != nil { + err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "policy", &obj.Policy, UnmarshalTemplatePolicy) if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "counts", &obj.Counts, UnmarshalTemplateCountData) if err != nil { + err = core.SDKErrorf(err, "", "counts-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6256,7 +6783,7 @@ type PolicyTemplateMetaData struct { // Constants associated with the PolicyTemplateMetaData.State property. // The policy state. const ( - PolicyTemplateMetaDataStateActiveConst = "active" + PolicyTemplateMetaDataStateActiveConst = "active" PolicyTemplateMetaDataStateDeletedConst = "deleted" ) @@ -6265,54 +6792,67 @@ func UnmarshalPolicyTemplateMetaData(m map[string]json.RawMessage, result interf obj := new(PolicyTemplateMetaData) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) if err != nil { + err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6330,6 +6870,7 @@ func UnmarshalPolicyTemplateVersionsCollection(m map[string]json.RawMessage, res obj := new(PolicyTemplateVersionsCollection) err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalPolicyTemplate) if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6367,11 +6908,11 @@ type ReplacePolicyOptions struct { // NewReplacePolicyOptions : Instantiate ReplacePolicyOptions func (*IamPolicyManagementV1) NewReplacePolicyOptions(policyID string, ifMatch string, typeVar string, subjects []PolicySubject, roles []PolicyRole, resources []PolicyResource) *ReplacePolicyOptions { return &ReplacePolicyOptions{ - PolicyID: core.StringPtr(policyID), - IfMatch: core.StringPtr(ifMatch), - Type: core.StringPtr(typeVar), - Subjects: subjects, - Roles: roles, + PolicyID: core.StringPtr(policyID), + IfMatch: core.StringPtr(ifMatch), + Type: core.StringPtr(typeVar), + Subjects: subjects, + Roles: roles, Resources: resources, } } @@ -6459,9 +7000,9 @@ type ReplacePolicyTemplateOptions struct { func (*IamPolicyManagementV1) NewReplacePolicyTemplateOptions(policyTemplateID string, version string, ifMatch string, policy *TemplatePolicy) *ReplacePolicyTemplateOptions { return &ReplacePolicyTemplateOptions{ PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), - IfMatch: core.StringPtr(ifMatch), - Policy: policy, + Version: core.StringPtr(version), + IfMatch: core.StringPtr(ifMatch), + Policy: policy, } } @@ -6539,10 +7080,10 @@ type ReplaceRoleOptions struct { // NewReplaceRoleOptions : Instantiate ReplaceRoleOptions func (*IamPolicyManagementV1) NewReplaceRoleOptions(roleID string, ifMatch string, displayName string, actions []string) *ReplaceRoleOptions { return &ReplaceRoleOptions{ - RoleID: core.StringPtr(roleID), - IfMatch: core.StringPtr(ifMatch), + RoleID: core.StringPtr(roleID), + IfMatch: core.StringPtr(ifMatch), DisplayName: core.StringPtr(displayName), - Actions: actions, + Actions: actions, } } @@ -6620,17 +7161,17 @@ type ReplaceV2PolicyOptions struct { // Constants associated with the ReplaceV2PolicyOptions.Type property. // The policy type; either 'access' or 'authorization'. const ( - ReplaceV2PolicyOptionsTypeAccessConst = "access" + ReplaceV2PolicyOptionsTypeAccessConst = "access" ReplaceV2PolicyOptionsTypeAuthorizationConst = "authorization" ) // NewReplaceV2PolicyOptions : Instantiate ReplaceV2PolicyOptions func (*IamPolicyManagementV1) NewReplaceV2PolicyOptions(id string, ifMatch string, control *Control, typeVar string) *ReplaceV2PolicyOptions { return &ReplaceV2PolicyOptions{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), Control: control, - Type: core.StringPtr(typeVar), + Type: core.StringPtr(typeVar), } } @@ -6709,10 +7250,13 @@ type ResourceAttribute struct { // NewResourceAttribute : Instantiate ResourceAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_model *ResourceAttribute, err error) { _model = &ResourceAttribute{ - Name: core.StringPtr(name), + Name: core.StringPtr(name), Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -6721,14 +7265,17 @@ func UnmarshalResourceAttribute(m map[string]json.RawMessage, result interface{} obj := new(ResourceAttribute) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6750,10 +7297,13 @@ type ResourceTag struct { // NewResourceTag : Instantiate ResourceTag (Generic Model Constructor) func (*IamPolicyManagementV1) NewResourceTag(name string, value string) (_model *ResourceTag, err error) { _model = &ResourceTag{ - Name: core.StringPtr(name), + Name: core.StringPtr(name), Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -6762,14 +7312,17 @@ func UnmarshalResourceTag(m map[string]json.RawMessage, result interface{}) (err obj := new(ResourceTag) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6797,9 +7350,12 @@ type Role struct { func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_model *Role, err error) { _model = &Role{ DisplayName: core.StringPtr(displayName), - Actions: actions, + Actions: actions, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -6808,18 +7364,22 @@ func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) obj := new(Role) err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6843,14 +7403,17 @@ func UnmarshalRoleAction(m map[string]json.RawMessage, result interface{}) (err obj := new(RoleAction) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-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)) @@ -6874,14 +7437,17 @@ func UnmarshalRoleCollection(m map[string]json.RawMessage, result interface{}) ( obj := new(RoleCollection) err = core.UnmarshalModel(m, "custom_roles", &obj.CustomRoles, UnmarshalCustomRole) if err != nil { + err = core.SDKErrorf(err, "", "custom_roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "service_roles", &obj.ServiceRoles, UnmarshalRole) if err != nil { + err = core.SDKErrorf(err, "", "service_roles-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "system_roles", &obj.SystemRoles, UnmarshalRole) if err != nil { + err = core.SDKErrorf(err, "", "system_roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6900,6 +7466,9 @@ func (*IamPolicyManagementV1) NewRoles(roleID string) (_model *Roles, err error) RoleID: core.StringPtr(roleID), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -6908,6 +7477,7 @@ func UnmarshalRoles(m map[string]json.RawMessage, result interface{}) (err error obj := new(Roles) err = core.UnmarshalPrimitive(m, "role_id", &obj.RoleID) if err != nil { + err = core.SDKErrorf(err, "", "role_id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6930,35 +7500,38 @@ type RuleAttribute struct { // Constants associated with the RuleAttribute.Operator property. // The operator of an attribute. const ( - RuleAttributeOperatorDategreaterthanConst = "dateGreaterThan" - RuleAttributeOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" - RuleAttributeOperatorDatelessthanConst = "dateLessThan" - RuleAttributeOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" - RuleAttributeOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" + RuleAttributeOperatorDategreaterthanConst = "dateGreaterThan" + RuleAttributeOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" + RuleAttributeOperatorDatelessthanConst = "dateLessThan" + RuleAttributeOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" + RuleAttributeOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" RuleAttributeOperatorDatetimegreaterthanorequalsConst = "dateTimeGreaterThanOrEquals" - RuleAttributeOperatorDatetimelessthanConst = "dateTimeLessThan" - RuleAttributeOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" - RuleAttributeOperatorDayofweekanyofConst = "dayOfWeekAnyOf" - RuleAttributeOperatorDayofweekequalsConst = "dayOfWeekEquals" - RuleAttributeOperatorStringequalsConst = "stringEquals" - RuleAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" - RuleAttributeOperatorStringexistsConst = "stringExists" - RuleAttributeOperatorStringmatchConst = "stringMatch" - RuleAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" - RuleAttributeOperatorTimegreaterthanConst = "timeGreaterThan" - RuleAttributeOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" - RuleAttributeOperatorTimelessthanConst = "timeLessThan" - RuleAttributeOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" + RuleAttributeOperatorDatetimelessthanConst = "dateTimeLessThan" + RuleAttributeOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" + RuleAttributeOperatorDayofweekanyofConst = "dayOfWeekAnyOf" + RuleAttributeOperatorDayofweekequalsConst = "dayOfWeekEquals" + RuleAttributeOperatorStringequalsConst = "stringEquals" + RuleAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" + RuleAttributeOperatorStringexistsConst = "stringExists" + RuleAttributeOperatorStringmatchConst = "stringMatch" + RuleAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" + RuleAttributeOperatorTimegreaterthanConst = "timeGreaterThan" + RuleAttributeOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" + RuleAttributeOperatorTimelessthanConst = "timeLessThan" + RuleAttributeOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" ) // NewRuleAttribute : Instantiate RuleAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewRuleAttribute(key string, operator string, value interface{}) (_model *RuleAttribute, err error) { _model = &RuleAttribute{ - Key: core.StringPtr(key), + Key: core.StringPtr(key), Operator: core.StringPtr(operator), - Value: value, + Value: value, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -6967,14 +7540,17 @@ func UnmarshalRuleAttribute(m map[string]json.RawMessage, result interface{}) (e obj := new(RuleAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -6993,10 +7569,13 @@ type SubjectAttribute struct { // NewSubjectAttribute : Instantiate SubjectAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewSubjectAttribute(name string, value string) (_model *SubjectAttribute, err error) { _model = &SubjectAttribute{ - Name: core.StringPtr(name), + Name: core.StringPtr(name), Value: core.StringPtr(value), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7005,10 +7584,12 @@ func UnmarshalSubjectAttribute(m map[string]json.RawMessage, result interface{}) obj := new(SubjectAttribute) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7029,10 +7610,12 @@ func UnmarshalTemplateCountData(m map[string]json.RawMessage, result interface{} obj := new(TemplateCountData) err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalLimitData) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalLimitData) if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7063,22 +7646,27 @@ func UnmarshalTemplateMetadata(m map[string]json.RawMessage, result interface{}) obj := new(TemplateMetadata) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "assignment_id", &obj.AssignmentID) if err != nil { + err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_id", &obj.RootID) if err != nil { + err = core.SDKErrorf(err, "", "root_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "root_version", &obj.RootVersion) if err != nil { + err = core.SDKErrorf(err, "", "root_version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7114,18 +7702,21 @@ type TemplatePolicy struct { // Constants associated with the TemplatePolicy.Type property. // The policy type; either 'access' or 'authorization'. const ( - TemplatePolicyTypeAccessConst = "access" + TemplatePolicyTypeAccessConst = "access" TemplatePolicyTypeAuthorizationConst = "authorization" ) // NewTemplatePolicy : Instantiate TemplatePolicy (Generic Model Constructor) func (*IamPolicyManagementV1) NewTemplatePolicy(typeVar string, resource *V2PolicyResource, control *Control) (_model *TemplatePolicy, err error) { _model = &TemplatePolicy{ - Type: core.StringPtr(typeVar), + Type: core.StringPtr(typeVar), Resource: resource, - Control: control, + Control: control, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7134,30 +7725,37 @@ func UnmarshalTemplatePolicy(m map[string]json.RawMessage, result interface{}) ( obj := new(TemplatePolicy) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource", &obj.Resource, UnmarshalV2PolicyResource) if err != nil { + err = core.SDKErrorf(err, "", "resource-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalV2PolicySubject) if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "pattern", &obj.Pattern) if err != nil { + err = core.SDKErrorf(err, "", "pattern-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "rule", &obj.Rule, UnmarshalV2PolicyRule) if err != nil { + err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControl) if err != nil { + err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7187,9 +7785,9 @@ type UpdatePolicyAssignmentOptions struct { // NewUpdatePolicyAssignmentOptions : Instantiate UpdatePolicyAssignmentOptions func (*IamPolicyManagementV1) NewUpdatePolicyAssignmentOptions(assignmentID string, version string, ifMatch string, templateVersion string) *UpdatePolicyAssignmentOptions { return &UpdatePolicyAssignmentOptions{ - AssignmentID: core.StringPtr(assignmentID), - Version: core.StringPtr(version), - IfMatch: core.StringPtr(ifMatch), + AssignmentID: core.StringPtr(assignmentID), + Version: core.StringPtr(version), + IfMatch: core.StringPtr(ifMatch), TemplateVersion: core.StringPtr(templateVersion), } } @@ -7243,7 +7841,7 @@ type UpdatePolicyStateOptions struct { // Constants associated with the UpdatePolicyStateOptions.State property. // The policy state. const ( - UpdatePolicyStateOptionsStateActiveConst = "active" + UpdatePolicyStateOptionsStateActiveConst = "active" UpdatePolicyStateOptionsStateDeletedConst = "deleted" ) @@ -7251,7 +7849,7 @@ const ( func (*IamPolicyManagementV1) NewUpdatePolicyStateOptions(policyID string, ifMatch string) *UpdatePolicyStateOptions { return &UpdatePolicyStateOptions{ PolicyID: core.StringPtr(policyID), - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), } } @@ -7314,7 +7912,7 @@ type UpdateSettingsOptions struct { func (*IamPolicyManagementV1) NewUpdateSettingsOptions(accountID string, ifMatch string) *UpdateSettingsOptions { return &UpdateSettingsOptions{ AccountID: core.StringPtr(accountID), - IfMatch: core.StringPtr(ifMatch), + IfMatch: core.StringPtr(ifMatch), } } @@ -7403,14 +8001,14 @@ type V2Policy struct { // Constants associated with the V2Policy.Type property. // The policy type; either 'access' or 'authorization'. const ( - V2PolicyTypeAccessConst = "access" + V2PolicyTypeAccessConst = "access" V2PolicyTypeAuthorizationConst = "authorization" ) // Constants associated with the V2Policy.State property. // The policy state, either 'deleted' or 'active'. const ( - V2PolicyStateActiveConst = "active" + V2PolicyStateActiveConst = "active" V2PolicyStateDeletedConst = "deleted" ) @@ -7419,66 +8017,82 @@ func UnmarshalV2Policy(m map[string]json.RawMessage, result interface{}) (err er obj := new(V2Policy) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalV2PolicySubject) if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource", &obj.Resource, UnmarshalV2PolicyResource) if err != nil { + err = core.SDKErrorf(err, "", "resource-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "pattern", &obj.Pattern) if err != nil { + err = core.SDKErrorf(err, "", "pattern-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "rule", &obj.Rule, UnmarshalV2PolicyRule) if err != nil { + err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControlResponse) if err != nil { + err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_at", &obj.LastPermitAt) if err != nil { + err = core.SDKErrorf(err, "", "last_permit_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_frequency", &obj.LastPermitFrequency) if err != nil { + err = core.SDKErrorf(err, "", "last_permit_frequency-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7496,6 +8110,7 @@ func UnmarshalV2PolicyCollection(m map[string]json.RawMessage, result interface{ obj := new(V2PolicyCollection) err = core.UnmarshalModel(m, "policies", &obj.Policies, UnmarshalV2PolicyTemplateMetaData) if err != nil { + err = core.SDKErrorf(err, "", "policies-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7517,6 +8132,9 @@ func (*IamPolicyManagementV1) NewV2PolicyResource(attributes []V2PolicyResourceA Attributes: attributes, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7525,10 +8143,12 @@ func UnmarshalV2PolicyResource(m map[string]json.RawMessage, result interface{}) obj := new(V2PolicyResource) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalV2PolicyResourceAttribute) if err != nil { + err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tags", &obj.Tags, UnmarshalV2PolicyResourceTag) if err != nil { + err = core.SDKErrorf(err, "", "tags-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7551,21 +8171,24 @@ type V2PolicyResourceAttribute struct { // Constants associated with the V2PolicyResourceAttribute.Operator property. // The operator of an attribute. const ( - V2PolicyResourceAttributeOperatorStringequalsConst = "stringEquals" + V2PolicyResourceAttributeOperatorStringequalsConst = "stringEquals" V2PolicyResourceAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" - V2PolicyResourceAttributeOperatorStringexistsConst = "stringExists" - V2PolicyResourceAttributeOperatorStringmatchConst = "stringMatch" - V2PolicyResourceAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" + V2PolicyResourceAttributeOperatorStringexistsConst = "stringExists" + V2PolicyResourceAttributeOperatorStringmatchConst = "stringMatch" + V2PolicyResourceAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" ) // NewV2PolicyResourceAttribute : Instantiate V2PolicyResourceAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewV2PolicyResourceAttribute(key string, operator string, value interface{}) (_model *V2PolicyResourceAttribute, err error) { _model = &V2PolicyResourceAttribute{ - Key: core.StringPtr(key), + Key: core.StringPtr(key), Operator: core.StringPtr(operator), - Value: value, + Value: value, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7574,14 +8197,17 @@ func UnmarshalV2PolicyResourceAttribute(m map[string]json.RawMessage, result int obj := new(V2PolicyResourceAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7604,17 +8230,20 @@ type V2PolicyResourceTag struct { // The operator of an access management tag. const ( V2PolicyResourceTagOperatorStringequalsConst = "stringEquals" - V2PolicyResourceTagOperatorStringmatchConst = "stringMatch" + V2PolicyResourceTagOperatorStringmatchConst = "stringMatch" ) // NewV2PolicyResourceTag : Instantiate V2PolicyResourceTag (Generic Model Constructor) func (*IamPolicyManagementV1) NewV2PolicyResourceTag(key string, value string, operator string) (_model *V2PolicyResourceTag, err error) { _model = &V2PolicyResourceTag{ - Key: core.StringPtr(key), - Value: core.StringPtr(value), + Key: core.StringPtr(key), + Value: core.StringPtr(value), Operator: core.StringPtr(operator), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7623,14 +8252,17 @@ func UnmarshalV2PolicyResourceTag(m map[string]json.RawMessage, result interface obj := new(V2PolicyResourceTag) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7660,26 +8292,27 @@ type V2PolicyRule struct { // Constants associated with the V2PolicyRule.Operator property. // The operator of an attribute. const ( - V2PolicyRuleOperatorDategreaterthanConst = "dateGreaterThan" - V2PolicyRuleOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" - V2PolicyRuleOperatorDatelessthanConst = "dateLessThan" - V2PolicyRuleOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" - V2PolicyRuleOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" + V2PolicyRuleOperatorDategreaterthanConst = "dateGreaterThan" + V2PolicyRuleOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" + V2PolicyRuleOperatorDatelessthanConst = "dateLessThan" + V2PolicyRuleOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" + V2PolicyRuleOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" V2PolicyRuleOperatorDatetimegreaterthanorequalsConst = "dateTimeGreaterThanOrEquals" - V2PolicyRuleOperatorDatetimelessthanConst = "dateTimeLessThan" - V2PolicyRuleOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" - V2PolicyRuleOperatorDayofweekanyofConst = "dayOfWeekAnyOf" - V2PolicyRuleOperatorDayofweekequalsConst = "dayOfWeekEquals" - V2PolicyRuleOperatorStringequalsConst = "stringEquals" - V2PolicyRuleOperatorStringequalsanyofConst = "stringEqualsAnyOf" - V2PolicyRuleOperatorStringexistsConst = "stringExists" - V2PolicyRuleOperatorStringmatchConst = "stringMatch" - V2PolicyRuleOperatorStringmatchanyofConst = "stringMatchAnyOf" - V2PolicyRuleOperatorTimegreaterthanConst = "timeGreaterThan" - V2PolicyRuleOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" - V2PolicyRuleOperatorTimelessthanConst = "timeLessThan" - V2PolicyRuleOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" + V2PolicyRuleOperatorDatetimelessthanConst = "dateTimeLessThan" + V2PolicyRuleOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" + V2PolicyRuleOperatorDayofweekanyofConst = "dayOfWeekAnyOf" + V2PolicyRuleOperatorDayofweekequalsConst = "dayOfWeekEquals" + V2PolicyRuleOperatorStringequalsConst = "stringEquals" + V2PolicyRuleOperatorStringequalsanyofConst = "stringEqualsAnyOf" + V2PolicyRuleOperatorStringexistsConst = "stringExists" + V2PolicyRuleOperatorStringmatchConst = "stringMatch" + V2PolicyRuleOperatorStringmatchanyofConst = "stringMatchAnyOf" + V2PolicyRuleOperatorTimegreaterthanConst = "timeGreaterThan" + V2PolicyRuleOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" + V2PolicyRuleOperatorTimelessthanConst = "timeLessThan" + V2PolicyRuleOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" ) + func (*V2PolicyRule) isaV2PolicyRule() bool { return true } @@ -7693,18 +8326,22 @@ func UnmarshalV2PolicyRule(m map[string]json.RawMessage, result interface{}) (er obj := new(V2PolicyRule) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalNestedCondition) if err != nil { + err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7723,6 +8360,9 @@ func (*IamPolicyManagementV1) NewV2PolicySubject(attributes []V2PolicySubjectAtt Attributes: attributes, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7731,6 +8371,7 @@ func UnmarshalV2PolicySubject(m map[string]json.RawMessage, result interface{}) obj := new(V2PolicySubject) err = core.UnmarshalModel(m, "attributes", &obj.Attributes, UnmarshalV2PolicySubjectAttribute) if err != nil { + err = core.SDKErrorf(err, "", "attributes-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7760,11 +8401,14 @@ const ( // NewV2PolicySubjectAttribute : Instantiate V2PolicySubjectAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewV2PolicySubjectAttribute(key string, operator string, value interface{}) (_model *V2PolicySubjectAttribute, err error) { _model = &V2PolicySubjectAttribute{ - Key: core.StringPtr(key), + Key: core.StringPtr(key), Operator: core.StringPtr(operator), - Value: value, + Value: value, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -7773,14 +8417,17 @@ func UnmarshalV2PolicySubjectAttribute(m map[string]json.RawMessage, result inte obj := new(V2PolicySubjectAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7846,14 +8493,14 @@ type V2PolicyTemplateMetaData struct { // Constants associated with the V2PolicyTemplateMetaData.Type property. // The policy type; either 'access' or 'authorization'. const ( - V2PolicyTemplateMetaDataTypeAccessConst = "access" + V2PolicyTemplateMetaDataTypeAccessConst = "access" V2PolicyTemplateMetaDataTypeAuthorizationConst = "authorization" ) // Constants associated with the V2PolicyTemplateMetaData.State property. // The policy state, either 'deleted' or 'active'. const ( - V2PolicyTemplateMetaDataStateActiveConst = "active" + V2PolicyTemplateMetaDataStateActiveConst = "active" V2PolicyTemplateMetaDataStateDeletedConst = "deleted" ) @@ -7862,70 +8509,87 @@ func UnmarshalV2PolicyTemplateMetaData(m map[string]json.RawMessage, result inte obj := new(V2PolicyTemplateMetaData) err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalV2PolicySubject) if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource", &obj.Resource, UnmarshalV2PolicyResource) if err != nil { + err = core.SDKErrorf(err, "", "resource-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "pattern", &obj.Pattern) if err != nil { + err = core.SDKErrorf(err, "", "pattern-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "rule", &obj.Rule, UnmarshalV2PolicyRule) if err != nil { + err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControlResponse) if err != nil { + err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "state", &obj.State) if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_at", &obj.LastPermitAt) if err != nil { + err = core.SDKErrorf(err, "", "last_permit_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_permit_frequency", &obj.LastPermitFrequency) if err != nil { + err = core.SDKErrorf(err, "", "last_permit_frequency-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7948,6 +8612,7 @@ func UnmarshalControlResponseControl(m map[string]json.RawMessage, result interf obj := new(ControlResponseControl) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7970,6 +8635,7 @@ func UnmarshalControlResponseControlWithEnrichedRoles(m map[string]json.RawMessa obj := new(ControlResponseControlWithEnrichedRoles) err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrantWithEnrichedRoles) if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7993,35 +8659,38 @@ type NestedConditionRuleAttribute struct { // Constants associated with the NestedConditionRuleAttribute.Operator property. // The operator of an attribute. const ( - NestedConditionRuleAttributeOperatorDategreaterthanConst = "dateGreaterThan" - NestedConditionRuleAttributeOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" - NestedConditionRuleAttributeOperatorDatelessthanConst = "dateLessThan" - NestedConditionRuleAttributeOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" - NestedConditionRuleAttributeOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" + NestedConditionRuleAttributeOperatorDategreaterthanConst = "dateGreaterThan" + NestedConditionRuleAttributeOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" + NestedConditionRuleAttributeOperatorDatelessthanConst = "dateLessThan" + NestedConditionRuleAttributeOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" + NestedConditionRuleAttributeOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" NestedConditionRuleAttributeOperatorDatetimegreaterthanorequalsConst = "dateTimeGreaterThanOrEquals" - NestedConditionRuleAttributeOperatorDatetimelessthanConst = "dateTimeLessThan" - NestedConditionRuleAttributeOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" - NestedConditionRuleAttributeOperatorDayofweekanyofConst = "dayOfWeekAnyOf" - NestedConditionRuleAttributeOperatorDayofweekequalsConst = "dayOfWeekEquals" - NestedConditionRuleAttributeOperatorStringequalsConst = "stringEquals" - NestedConditionRuleAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" - NestedConditionRuleAttributeOperatorStringexistsConst = "stringExists" - NestedConditionRuleAttributeOperatorStringmatchConst = "stringMatch" - NestedConditionRuleAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" - NestedConditionRuleAttributeOperatorTimegreaterthanConst = "timeGreaterThan" - NestedConditionRuleAttributeOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" - NestedConditionRuleAttributeOperatorTimelessthanConst = "timeLessThan" - NestedConditionRuleAttributeOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" + NestedConditionRuleAttributeOperatorDatetimelessthanConst = "dateTimeLessThan" + NestedConditionRuleAttributeOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" + NestedConditionRuleAttributeOperatorDayofweekanyofConst = "dayOfWeekAnyOf" + NestedConditionRuleAttributeOperatorDayofweekequalsConst = "dayOfWeekEquals" + NestedConditionRuleAttributeOperatorStringequalsConst = "stringEquals" + NestedConditionRuleAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" + NestedConditionRuleAttributeOperatorStringexistsConst = "stringExists" + NestedConditionRuleAttributeOperatorStringmatchConst = "stringMatch" + NestedConditionRuleAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" + NestedConditionRuleAttributeOperatorTimegreaterthanConst = "timeGreaterThan" + NestedConditionRuleAttributeOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" + NestedConditionRuleAttributeOperatorTimelessthanConst = "timeLessThan" + NestedConditionRuleAttributeOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" ) // NewNestedConditionRuleAttribute : Instantiate NestedConditionRuleAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewNestedConditionRuleAttribute(key string, operator string, value interface{}) (_model *NestedConditionRuleAttribute, err error) { _model = &NestedConditionRuleAttribute{ - Key: core.StringPtr(key), + Key: core.StringPtr(key), Operator: core.StringPtr(operator), - Value: value, + Value: value, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -8034,14 +8703,17 @@ func UnmarshalNestedConditionRuleAttribute(m map[string]json.RawMessage, result obj := new(NestedConditionRuleAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8063,16 +8735,19 @@ type NestedConditionRuleWithConditions struct { // Operator to evaluate conditions. const ( NestedConditionRuleWithConditionsOperatorAndConst = "and" - NestedConditionRuleWithConditionsOperatorOrConst = "or" + NestedConditionRuleWithConditionsOperatorOrConst = "or" ) // NewNestedConditionRuleWithConditions : Instantiate NestedConditionRuleWithConditions (Generic Model Constructor) func (*IamPolicyManagementV1) NewNestedConditionRuleWithConditions(operator string, conditions []RuleAttribute) (_model *NestedConditionRuleWithConditions, err error) { _model = &NestedConditionRuleWithConditions{ - Operator: core.StringPtr(operator), + Operator: core.StringPtr(operator), Conditions: conditions, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -8085,10 +8760,12 @@ func UnmarshalNestedConditionRuleWithConditions(m map[string]json.RawMessage, re obj := new(NestedConditionRuleWithConditions) err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalRuleAttribute) if err != nil { + err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8153,10 +8830,10 @@ const ( // Constants associated with the PolicyTemplateAssignmentItemsPolicyAssignment.Status property. // The policy assignment status. const ( - PolicyTemplateAssignmentItemsPolicyAssignmentStatusFailedConst = "failed" - PolicyTemplateAssignmentItemsPolicyAssignmentStatusInProgressConst = "in_progress" + PolicyTemplateAssignmentItemsPolicyAssignmentStatusFailedConst = "failed" + PolicyTemplateAssignmentItemsPolicyAssignmentStatusInProgressConst = "in_progress" PolicyTemplateAssignmentItemsPolicyAssignmentStatusSucceedWithErrorsConst = "succeed_with_errors" - PolicyTemplateAssignmentItemsPolicyAssignmentStatusSucceededConst = "succeeded" + PolicyTemplateAssignmentItemsPolicyAssignmentStatusSucceededConst = "succeeded" ) func (*PolicyTemplateAssignmentItemsPolicyAssignment) isaPolicyTemplateAssignmentItems() bool { @@ -8168,62 +8845,77 @@ func UnmarshalPolicyTemplateAssignmentItemsPolicyAssignment(m map[string]json.Ra obj := new(PolicyTemplateAssignmentItemsPolicyAssignment) 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, "assignment_id", &obj.AssignmentID) if err != nil { + err = core.SDKErrorf(err, "", "assignment_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "target_type", &obj.TargetType) if err != nil { + err = core.SDKErrorf(err, "", "target_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "target", &obj.Target) if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentOptions) if err != nil { + err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentResources) if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8276,10 +8968,10 @@ type PolicyTemplateAssignmentItemsPolicyAssignmentV1 struct { // Constants associated with the PolicyTemplateAssignmentItemsPolicyAssignmentV1.Status property. // The policy assignment status. const ( - PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusFailedConst = "failed" - PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusInProgressConst = "in_progress" + PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusFailedConst = "failed" + PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusInProgressConst = "in_progress" PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusSucceedWithErrorsConst = "succeed_with_errors" - PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusSucceededConst = "succeeded" + PolicyTemplateAssignmentItemsPolicyAssignmentV1StatusSucceededConst = "succeeded" ) func (*PolicyTemplateAssignmentItemsPolicyAssignmentV1) isaPolicyTemplateAssignmentItems() bool { @@ -8291,54 +8983,67 @@ func UnmarshalPolicyTemplateAssignmentItemsPolicyAssignmentV1(m map[string]json. obj := new(PolicyTemplateAssignmentItemsPolicyAssignmentV1) err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "options", &obj.Options, UnmarshalPolicyAssignmentV1Options) if err != nil { + err = core.SDKErrorf(err, "", "options-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-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.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8362,35 +9067,38 @@ type V2PolicyRuleRuleAttribute struct { // Constants associated with the V2PolicyRuleRuleAttribute.Operator property. // The operator of an attribute. const ( - V2PolicyRuleRuleAttributeOperatorDategreaterthanConst = "dateGreaterThan" - V2PolicyRuleRuleAttributeOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" - V2PolicyRuleRuleAttributeOperatorDatelessthanConst = "dateLessThan" - V2PolicyRuleRuleAttributeOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" - V2PolicyRuleRuleAttributeOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" + V2PolicyRuleRuleAttributeOperatorDategreaterthanConst = "dateGreaterThan" + V2PolicyRuleRuleAttributeOperatorDategreaterthanorequalsConst = "dateGreaterThanOrEquals" + V2PolicyRuleRuleAttributeOperatorDatelessthanConst = "dateLessThan" + V2PolicyRuleRuleAttributeOperatorDatelessthanorequalsConst = "dateLessThanOrEquals" + V2PolicyRuleRuleAttributeOperatorDatetimegreaterthanConst = "dateTimeGreaterThan" V2PolicyRuleRuleAttributeOperatorDatetimegreaterthanorequalsConst = "dateTimeGreaterThanOrEquals" - V2PolicyRuleRuleAttributeOperatorDatetimelessthanConst = "dateTimeLessThan" - V2PolicyRuleRuleAttributeOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" - V2PolicyRuleRuleAttributeOperatorDayofweekanyofConst = "dayOfWeekAnyOf" - V2PolicyRuleRuleAttributeOperatorDayofweekequalsConst = "dayOfWeekEquals" - V2PolicyRuleRuleAttributeOperatorStringequalsConst = "stringEquals" - V2PolicyRuleRuleAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" - V2PolicyRuleRuleAttributeOperatorStringexistsConst = "stringExists" - V2PolicyRuleRuleAttributeOperatorStringmatchConst = "stringMatch" - V2PolicyRuleRuleAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" - V2PolicyRuleRuleAttributeOperatorTimegreaterthanConst = "timeGreaterThan" - V2PolicyRuleRuleAttributeOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" - V2PolicyRuleRuleAttributeOperatorTimelessthanConst = "timeLessThan" - V2PolicyRuleRuleAttributeOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" + V2PolicyRuleRuleAttributeOperatorDatetimelessthanConst = "dateTimeLessThan" + V2PolicyRuleRuleAttributeOperatorDatetimelessthanorequalsConst = "dateTimeLessThanOrEquals" + V2PolicyRuleRuleAttributeOperatorDayofweekanyofConst = "dayOfWeekAnyOf" + V2PolicyRuleRuleAttributeOperatorDayofweekequalsConst = "dayOfWeekEquals" + V2PolicyRuleRuleAttributeOperatorStringequalsConst = "stringEquals" + V2PolicyRuleRuleAttributeOperatorStringequalsanyofConst = "stringEqualsAnyOf" + V2PolicyRuleRuleAttributeOperatorStringexistsConst = "stringExists" + V2PolicyRuleRuleAttributeOperatorStringmatchConst = "stringMatch" + V2PolicyRuleRuleAttributeOperatorStringmatchanyofConst = "stringMatchAnyOf" + V2PolicyRuleRuleAttributeOperatorTimegreaterthanConst = "timeGreaterThan" + V2PolicyRuleRuleAttributeOperatorTimegreaterthanorequalsConst = "timeGreaterThanOrEquals" + V2PolicyRuleRuleAttributeOperatorTimelessthanConst = "timeLessThan" + V2PolicyRuleRuleAttributeOperatorTimelessthanorequalsConst = "timeLessThanOrEquals" ) // NewV2PolicyRuleRuleAttribute : Instantiate V2PolicyRuleRuleAttribute (Generic Model Constructor) func (*IamPolicyManagementV1) NewV2PolicyRuleRuleAttribute(key string, operator string, value interface{}) (_model *V2PolicyRuleRuleAttribute, err error) { _model = &V2PolicyRuleRuleAttribute{ - Key: core.StringPtr(key), + Key: core.StringPtr(key), Operator: core.StringPtr(operator), - Value: value, + Value: value, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -8403,14 +9111,17 @@ func UnmarshalV2PolicyRuleRuleAttribute(m map[string]json.RawMessage, result int obj := new(V2PolicyRuleRuleAttribute) err = core.UnmarshalPrimitive(m, "key", &obj.Key) if err != nil { + err = core.SDKErrorf(err, "", "key-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -8432,16 +9143,19 @@ type V2PolicyRuleRuleWithNestedConditions struct { // Operator to evaluate conditions. const ( V2PolicyRuleRuleWithNestedConditionsOperatorAndConst = "and" - V2PolicyRuleRuleWithNestedConditionsOperatorOrConst = "or" + V2PolicyRuleRuleWithNestedConditionsOperatorOrConst = "or" ) // NewV2PolicyRuleRuleWithNestedConditions : Instantiate V2PolicyRuleRuleWithNestedConditions (Generic Model Constructor) func (*IamPolicyManagementV1) NewV2PolicyRuleRuleWithNestedConditions(operator string, conditions []NestedConditionIntf) (_model *V2PolicyRuleRuleWithNestedConditions, err error) { _model = &V2PolicyRuleRuleWithNestedConditions{ - Operator: core.StringPtr(operator), + Operator: core.StringPtr(operator), Conditions: conditions, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -8454,10 +9168,12 @@ func UnmarshalV2PolicyRuleRuleWithNestedConditions(m map[string]json.RawMessage, obj := new(V2PolicyRuleRuleWithNestedConditions) err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "conditions", &obj.Conditions, UnmarshalNestedCondition) if err != nil { + err = core.SDKErrorf(err, "", "conditions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) diff --git a/iampolicymanagementv1/iam_policy_management_v1_examples_test.go b/iampolicymanagementv1/iam_policy_management_v1_examples_test.go index 1b20c358..40a6424e 100644 --- a/iampolicymanagementv1/iam_policy_management_v1_examples_test.go +++ b/iampolicymanagementv1/iam_policy_management_v1_examples_test.go @@ -1234,14 +1234,14 @@ var _ = Describe(`IamPolicyManagementV1 Examples Tests`, func() { exampleAccountSettingsETag, ) identityTypesBase := &iampolicymanagementv1.IdentityTypesBase{ - State: core.StringPtr("monitor"), + State: core.StringPtr("monitor"), ExternalAllowedAccounts: []string{}, } identityTypes := &iampolicymanagementv1.IdentityTypesPatch{ - User: identityTypesBase, + User: identityTypesBase, ServiceID: identityTypesBase, - Service: identityTypesBase, + Service: identityTypesBase, } externalAccountIdentityInteraction := &iampolicymanagementv1.ExternalAccountIdentityInteractionPatch{ diff --git a/iampolicymanagementv1/iam_policy_management_v1_integration_test.go b/iampolicymanagementv1/iam_policy_management_v1_integration_test.go index f35ab7cd..206921d7 100644 --- a/iampolicymanagementv1/iam_policy_management_v1_integration_test.go +++ b/iampolicymanagementv1/iam_policy_management_v1_integration_test.go @@ -1273,7 +1273,7 @@ var _ = Describe("IAM Policy Management - Integration Tests", func() { }) It(`GetSettings(getSettingsOptions *GetSettingsOptions)`, func() { getSettingsOptions := &iampolicymanagementv1.GetSettingsOptions{ - AccountID: &testAccountID, + AccountID: &testAccountID, AcceptLanguage: core.StringPtr("default"), } @@ -1291,14 +1291,14 @@ var _ = Describe("IAM Policy Management - Integration Tests", func() { }) It(`UpdateSettings(updateSettingsOptions *UpdateSettingsOptions)`, func() { identityTypesBaseModel := &iampolicymanagementv1.IdentityTypesBase{ - State: core.StringPtr("monitor"), + State: core.StringPtr("monitor"), ExternalAllowedAccounts: []string{}, } identityTypesPatchModel := &iampolicymanagementv1.IdentityTypesPatch{ - User: identityTypesBaseModel, + User: identityTypesBaseModel, ServiceID: identityTypesBaseModel, - Service: identityTypesBaseModel, + Service: identityTypesBaseModel, } externalAccountIdentityInteractionPatchModel := &iampolicymanagementv1.ExternalAccountIdentityInteractionPatch{ @@ -1306,10 +1306,10 @@ var _ = Describe("IAM Policy Management - Integration Tests", func() { } updateSettingsOptions := &iampolicymanagementv1.UpdateSettingsOptions{ - AccountID: &testAccountID, - IfMatch: &testAcountSettingsETag, + AccountID: &testAccountID, + IfMatch: &testAcountSettingsETag, ExternalAccountIdentityInteraction: externalAccountIdentityInteractionPatchModel, - AcceptLanguage: core.StringPtr("default"), + AcceptLanguage: core.StringPtr("default"), } accountSettingsAccessManagement, response, err := service.UpdateSettings(updateSettingsOptions) diff --git a/iampolicymanagementv1/iam_policy_management_v1_test.go b/iampolicymanagementv1/iam_policy_management_v1_test.go index b512e270..8d91ea4a 100644 --- a/iampolicymanagementv1/iam_policy_management_v1_test.go +++ b/iampolicymanagementv1/iam_policy_management_v1_test.go @@ -19,6 +19,8 @@ package iampolicymanagementv1_test import ( "bytes" "context" + "encoding/base64" + "encoding/json" "fmt" "io" "net/http" @@ -66,14 +68,13 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Context(`Using external config, construct service client instances`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "IAM_POLICY_MANAGEMENT_URL": "https://iampolicymanagementv1/api", + "IAM_POLICY_MANAGEMENT_URL": "https://iampolicymanagementv1/api", "IAM_POLICY_MANAGEMENT_AUTH_TYPE": "noauth", } It(`Create service client using external config successfully`, func() { SetTestEnvironment(testEnvironment) - iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1UsingExternalConfig(&iampolicymanagementv1.IamPolicyManagementV1Options{ - }) + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1UsingExternalConfig(&iampolicymanagementv1.IamPolicyManagementV1Options{}) Expect(iamPolicyManagementService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) @@ -102,8 +103,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) - iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1UsingExternalConfig(&iampolicymanagementv1.IamPolicyManagementV1Options{ - }) + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1UsingExternalConfig(&iampolicymanagementv1.IamPolicyManagementV1Options{}) err := iamPolicyManagementService.SetServiceURL("https://testService/api") Expect(err).To(BeNil()) Expect(iamPolicyManagementService).ToNot(BeNil()) @@ -121,13 +121,12 @@ var _ = Describe(`IamPolicyManagementV1`, 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_POLICY_MANAGEMENT_URL": "https://iampolicymanagementv1/api", + "IAM_POLICY_MANAGEMENT_URL": "https://iampolicymanagementv1/api", "IAM_POLICY_MANAGEMENT_AUTH_TYPE": "someOtherAuth", } SetTestEnvironment(testEnvironment) - iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1UsingExternalConfig(&iampolicymanagementv1.IamPolicyManagementV1Options{ - }) + iamPolicyManagementService, serviceErr := iampolicymanagementv1.NewIamPolicyManagementV1UsingExternalConfig(&iampolicymanagementv1.IamPolicyManagementV1Options{}) It(`Instantiate service client with error`, func() { Expect(iamPolicyManagementService).To(BeNil()) @@ -138,7 +137,7 @@ var _ = Describe(`IamPolicyManagementV1`, 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_POLICY_MANAGEMENT_AUTH_TYPE": "NOAuth", + "IAM_POLICY_MANAGEMENT_AUTH_TYPE": "NOAuth", } SetTestEnvironment(testEnvironment) @@ -3276,7 +3275,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3286,7 +3285,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3303,7 +3302,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3397,7 +3396,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3407,7 +3406,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3424,7 +3423,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3526,7 +3525,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3536,7 +3535,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3553,7 +3552,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3598,7 +3597,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3608,7 +3607,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3625,7 +3624,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3691,7 +3690,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3701,7 +3700,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3718,7 +3717,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the CreateV2PolicyOptions model createV2PolicyOptionsModel := new(iampolicymanagementv1.CreateV2PolicyOptions) @@ -3786,7 +3785,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3796,7 +3795,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3813,7 +3812,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -3908,7 +3907,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -3918,7 +3917,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -3935,7 +3934,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4038,7 +4037,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4048,7 +4047,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4065,7 +4064,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4111,7 +4110,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4121,7 +4120,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4138,7 +4137,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4205,7 +4204,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4215,7 +4214,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4232,7 +4231,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the ReplaceV2PolicyOptions model replaceV2PolicyOptionsModel := new(iampolicymanagementv1.ReplaceV2PolicyOptions) @@ -4851,7 +4850,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4868,7 +4867,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -4878,7 +4877,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -4980,7 +4979,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -4997,7 +4996,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5007,7 +5006,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5117,7 +5116,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5134,7 +5133,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5144,7 +5143,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5197,7 +5196,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5214,7 +5213,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5224,7 +5223,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5298,7 +5297,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5315,7 +5314,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5325,7 +5324,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5687,7 +5686,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5704,7 +5703,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5714,7 +5713,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5813,7 +5812,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5830,7 +5829,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5840,7 +5839,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -5947,7 +5946,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -5964,7 +5963,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -5974,7 +5973,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6026,7 +6025,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6043,7 +6042,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6053,7 +6052,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6126,7 +6125,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6143,7 +6142,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6153,7 +6152,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6448,7 +6447,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6465,7 +6464,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6475,7 +6474,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6578,7 +6577,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6595,7 +6594,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6605,7 +6604,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6716,7 +6715,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6733,7 +6732,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6743,7 +6742,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6797,7 +6796,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6814,7 +6813,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6824,7 +6823,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -6899,7 +6898,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyResourceAttributeModel := new(iampolicymanagementv1.V2PolicyResourceAttribute) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -6916,7 +6915,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicySubjectAttributeModel := new(iampolicymanagementv1.V2PolicySubjectAttribute) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -6926,7 +6925,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { v2PolicyRuleModel := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -9266,10 +9265,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -9294,10 +9293,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -9310,10 +9309,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyRuleModel.Value).To(Equal("testString")) // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -9378,10 +9377,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -9406,10 +9405,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -9422,10 +9421,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyRuleModel.Value).To(Equal("testString")) // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -9531,10 +9530,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -9547,10 +9546,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -9575,10 +9574,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyRuleModel.Value).To(Equal("testString")) // Construct an instance of the CreateV2PolicyOptions model var createV2PolicyOptionsControl *iampolicymanagementv1.Control = nil @@ -9988,10 +9987,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -10016,10 +10015,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -10032,10 +10031,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyRuleModel.Value).To(Equal("testString")) // Construct an instance of the Roles model rolesModel := new(iampolicymanagementv1.Roles) @@ -10142,10 +10141,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicySubjectAttributeModel).ToNot(BeNil()) v2PolicySubjectAttributeModel.Key = core.StringPtr("testString") v2PolicySubjectAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicySubjectAttributeModel.Value = core.StringPtr("testString") + v2PolicySubjectAttributeModel.Value = "testString" Expect(v2PolicySubjectAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicySubjectAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicySubjectAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicySubjectAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicySubject model v2PolicySubjectModel := new(iampolicymanagementv1.V2PolicySubject) @@ -10158,10 +10157,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyResourceAttributeModel).ToNot(BeNil()) v2PolicyResourceAttributeModel.Key = core.StringPtr("testString") v2PolicyResourceAttributeModel.Operator = core.StringPtr("stringEquals") - v2PolicyResourceAttributeModel.Value = core.StringPtr("testString") + v2PolicyResourceAttributeModel.Value = "testString" Expect(v2PolicyResourceAttributeModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyResourceAttributeModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyResourceAttributeModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyResourceAttributeModel.Value).To(Equal("testString")) // Construct an instance of the V2PolicyResourceTag model v2PolicyResourceTagModel := new(iampolicymanagementv1.V2PolicyResourceTag) @@ -10186,10 +10185,10 @@ var _ = Describe(`IamPolicyManagementV1`, func() { Expect(v2PolicyRuleModel).ToNot(BeNil()) v2PolicyRuleModel.Key = core.StringPtr("testString") v2PolicyRuleModel.Operator = core.StringPtr("stringEquals") - v2PolicyRuleModel.Value = core.StringPtr("testString") + v2PolicyRuleModel.Value = "testString" Expect(v2PolicyRuleModel.Key).To(Equal(core.StringPtr("testString"))) Expect(v2PolicyRuleModel.Operator).To(Equal(core.StringPtr("stringEquals"))) - Expect(v2PolicyRuleModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(v2PolicyRuleModel.Value).To(Equal("testString")) // Construct an instance of the ReplaceV2PolicyOptions model id := "testString" @@ -10249,7 +10248,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewRuleAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := core.StringPtr("testString") + value := "testString" _model, err := iamPolicyManagementService.NewRuleAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -10352,7 +10351,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewV2PolicyResourceAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := core.StringPtr("testString") + value := "testString" _model, err := iamPolicyManagementService.NewV2PolicyResourceAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -10374,7 +10373,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewV2PolicySubjectAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := core.StringPtr("testString") + value := "testString" _model, err := iamPolicyManagementService.NewV2PolicySubjectAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -10382,7 +10381,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewNestedConditionRuleAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := core.StringPtr("testString") + value := "testString" _model, err := iamPolicyManagementService.NewNestedConditionRuleAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -10397,7 +10396,7 @@ var _ = Describe(`IamPolicyManagementV1`, func() { It(`Invoke NewV2PolicyRuleRuleAttribute successfully`, func() { key := "testString" operator := "stringEquals" - value := core.StringPtr("testString") + value := "testString" _model, err := iamPolicyManagementService.NewV2PolicyRuleRuleAttribute(key, operator, value) Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) @@ -10411,9 +10410,615 @@ var _ = Describe(`IamPolicyManagementV1`, func() { }) }) }) + Describe(`Model unmarshaling tests`, func() { + It(`Invoke UnmarshalAssignmentTargetDetails successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.AssignmentTargetDetails) + model.Type = core.StringPtr("Account") + model.ID = core.StringPtr("testString") + + 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 *iampolicymanagementv1.AssignmentTargetDetails + err = iampolicymanagementv1.UnmarshalAssignmentTargetDetails(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalAssignmentTemplateDetails successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.AssignmentTemplateDetails) + model.ID = core.StringPtr("testString") + model.Version = core.StringPtr("testString") + + 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 *iampolicymanagementv1.AssignmentTemplateDetails + err = iampolicymanagementv1.UnmarshalAssignmentTemplateDetails(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalControl successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.Control) + model.Grant = 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 *iampolicymanagementv1.Control + err = iampolicymanagementv1.UnmarshalControl(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalExternalAccountIdentityInteractionPatch successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.ExternalAccountIdentityInteractionPatch) + model.IdentityTypes = 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 *iampolicymanagementv1.ExternalAccountIdentityInteractionPatch + err = iampolicymanagementv1.UnmarshalExternalAccountIdentityInteractionPatch(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalGrant successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.Grant) + model.Roles = 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 *iampolicymanagementv1.Grant + err = iampolicymanagementv1.UnmarshalGrant(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalIdentityTypesBase successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.IdentityTypesBase) + model.State = core.StringPtr("enabled") + model.ExternalAllowedAccounts = []string{"testString"} + + 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 *iampolicymanagementv1.IdentityTypesBase + err = iampolicymanagementv1.UnmarshalIdentityTypesBase(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalIdentityTypesPatch successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.IdentityTypesPatch) + model.User = nil + model.ServiceID = nil + model.Service = 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 *iampolicymanagementv1.IdentityTypesPatch + err = iampolicymanagementv1.UnmarshalIdentityTypesPatch(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalNestedCondition successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.NestedCondition) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + model.Conditions = 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 *iampolicymanagementv1.NestedCondition + err = iampolicymanagementv1.UnmarshalNestedCondition(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalPolicyAssignmentV1Options successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.PolicyAssignmentV1Options) + model.Root = 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 *iampolicymanagementv1.PolicyAssignmentV1Options + err = iampolicymanagementv1.UnmarshalPolicyAssignmentV1Options(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalPolicyAssignmentV1OptionsRoot successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.PolicyAssignmentV1OptionsRoot) + model.RequesterID = core.StringPtr("testString") + model.AssignmentID = core.StringPtr("testString") + model.Template = 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 *iampolicymanagementv1.PolicyAssignmentV1OptionsRoot + err = iampolicymanagementv1.UnmarshalPolicyAssignmentV1OptionsRoot(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalPolicyAssignmentV1OptionsRootTemplate successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.PolicyAssignmentV1OptionsRootTemplate) + model.ID = core.StringPtr("testString") + model.Version = core.StringPtr("testString") + + 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 *iampolicymanagementv1.PolicyAssignmentV1OptionsRootTemplate + err = iampolicymanagementv1.UnmarshalPolicyAssignmentV1OptionsRootTemplate(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalPolicyResource successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.PolicyResource) + model.Attributes = nil + model.Tags = 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 *iampolicymanagementv1.PolicyResource + err = iampolicymanagementv1.UnmarshalPolicyResource(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalPolicyRole successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.PolicyRole) + model.RoleID = core.StringPtr("testString") + model.DisplayName = core.StringPtr("testString") + model.Description = core.StringPtr("testString") + + 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 *iampolicymanagementv1.PolicyRole + err = iampolicymanagementv1.UnmarshalPolicyRole(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalPolicySubject successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.PolicySubject) + model.Attributes = 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 *iampolicymanagementv1.PolicySubject + err = iampolicymanagementv1.UnmarshalPolicySubject(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalResourceAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.ResourceAttribute) + model.Name = core.StringPtr("testString") + model.Value = core.StringPtr("testString") + model.Operator = core.StringPtr("testString") + + 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 *iampolicymanagementv1.ResourceAttribute + err = iampolicymanagementv1.UnmarshalResourceAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalResourceTag successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.ResourceTag) + model.Name = core.StringPtr("testString") + model.Value = core.StringPtr("testString") + model.Operator = core.StringPtr("testString") + + 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 *iampolicymanagementv1.ResourceTag + err = iampolicymanagementv1.UnmarshalResourceTag(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalRole successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.Role) + model.DisplayName = core.StringPtr("testString") + model.Description = core.StringPtr("testString") + model.Actions = []string{"testString"} + model.CRN = core.StringPtr("testString") + + 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 *iampolicymanagementv1.Role + err = iampolicymanagementv1.UnmarshalRole(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalRoles successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.Roles) + model.RoleID = core.StringPtr("testString") + + 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 *iampolicymanagementv1.Roles + err = iampolicymanagementv1.UnmarshalRoles(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalRuleAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.RuleAttribute) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + + 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 *iampolicymanagementv1.RuleAttribute + err = iampolicymanagementv1.UnmarshalRuleAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalSubjectAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.SubjectAttribute) + model.Name = core.StringPtr("testString") + model.Value = core.StringPtr("testString") + + 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 *iampolicymanagementv1.SubjectAttribute + err = iampolicymanagementv1.UnmarshalSubjectAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalTemplatePolicy successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.TemplatePolicy) + model.Type = core.StringPtr("access") + model.Description = core.StringPtr("testString") + model.Resource = nil + model.Subject = nil + model.Pattern = core.StringPtr("testString") + model.Rule = nil + model.Control = 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 *iampolicymanagementv1.TemplatePolicy + err = iampolicymanagementv1.UnmarshalTemplatePolicy(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicyResource successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicyResource) + model.Attributes = nil + model.Tags = 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 *iampolicymanagementv1.V2PolicyResource + err = iampolicymanagementv1.UnmarshalV2PolicyResource(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicyResourceAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicyResourceAttribute) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + + 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 *iampolicymanagementv1.V2PolicyResourceAttribute + err = iampolicymanagementv1.UnmarshalV2PolicyResourceAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicyResourceTag successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicyResourceTag) + model.Key = core.StringPtr("testString") + model.Value = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + + 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 *iampolicymanagementv1.V2PolicyResourceTag + err = iampolicymanagementv1.UnmarshalV2PolicyResourceTag(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicyRule successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicyRule) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + model.Conditions = 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 *iampolicymanagementv1.V2PolicyRule + err = iampolicymanagementv1.UnmarshalV2PolicyRule(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicySubject successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicySubject) + model.Attributes = 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 *iampolicymanagementv1.V2PolicySubject + err = iampolicymanagementv1.UnmarshalV2PolicySubject(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicySubjectAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicySubjectAttribute) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + + 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 *iampolicymanagementv1.V2PolicySubjectAttribute + err = iampolicymanagementv1.UnmarshalV2PolicySubjectAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalNestedConditionRuleAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.NestedConditionRuleAttribute) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + + 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 *iampolicymanagementv1.NestedConditionRuleAttribute + err = iampolicymanagementv1.UnmarshalNestedConditionRuleAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalNestedConditionRuleWithConditions successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.NestedConditionRuleWithConditions) + model.Operator = core.StringPtr("and") + model.Conditions = 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 *iampolicymanagementv1.NestedConditionRuleWithConditions + err = iampolicymanagementv1.UnmarshalNestedConditionRuleWithConditions(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicyRuleRuleAttribute successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicyRuleRuleAttribute) + model.Key = core.StringPtr("testString") + model.Operator = core.StringPtr("stringEquals") + model.Value = "testString" + + 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 *iampolicymanagementv1.V2PolicyRuleRuleAttribute + err = iampolicymanagementv1.UnmarshalV2PolicyRuleRuleAttribute(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) + It(`Invoke UnmarshalV2PolicyRuleRuleWithNestedConditions successfully`, func() { + // Construct an instance of the model. + model := new(iampolicymanagementv1.V2PolicyRuleRuleWithNestedConditions) + model.Operator = core.StringPtr("and") + model.Conditions = 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 *iampolicymanagementv1.V2PolicyRuleRuleWithNestedConditions + err = iampolicymanagementv1.UnmarshalV2PolicyRuleRuleWithNestedConditions(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + 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() { @@ -10439,9 +11044,11 @@ var _ = Describe(`IamPolicyManagementV1`, func() { // Utility functions used by the generated test code // -func CreateMockByteArray(mockData string) *[]byte { - ba := make([]byte, 0) - ba = append(ba, mockData...) +func CreateMockByteArray(encodedString string) *[]byte { + ba, err := base64.StdEncoding.DecodeString(encodedString) + if err != nil { + panic(err) + } return &ba }