From 42cb0befe3108837e2a1a9ce0a528a38b5a9a001 Mon Sep 17 00:00:00 2001 From: Phil Adams Date: Fri, 11 Dec 2020 10:22:27 -0600 Subject: [PATCH] fix(IAM Identity Service): re-gen service with latest API --- iamidentityv1/iam_identity_v1.go | 747 +++++----- .../iam_identity_v1_examples_test.go | 102 +- .../iam_identity_v1_integration_test.go | 172 +-- iamidentityv1/iam_identity_v1_test.go | 1324 +++++++++-------- 4 files changed, 1194 insertions(+), 1151 deletions(-) diff --git a/iamidentityv1/iam_identity_v1.go b/iamidentityv1/iam_identity_v1.go index 43056cc5..bdaddbd8 100644 --- a/iamidentityv1/iam_identity_v1.go +++ b/iamidentityv1/iam_identity_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-ef9b3113-20201118-074613 + * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-d753183b-20201209-163011 */ @@ -109,6 +109,21 @@ func NewIamIdentityV1(options *IamIdentityV1Options) (service *IamIdentityV1, er return } +// 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") +} + +// Clone makes a copy of "iamIdentity" suitable for processing requests. +func (iamIdentity *IamIdentityV1) Clone() *IamIdentityV1 { + if core.IsNil(iamIdentity) { + return nil + } + clone := *iamIdentity + clone.Service = iamIdentity.Service.Clone() + return &clone +} + // SetServiceURL sets the service URL func (iamIdentity *IamIdentityV1) SetServiceURL(url string) error { return iamIdentity.Service.SetServiceURL(url) @@ -145,18 +160,18 @@ func (iamIdentity *IamIdentityV1) DisableRetries() { iamIdentity.Service.DisableRetries() } -// ListApiKeys : Get API keys for a given service or user IAM ID and account ID +// ListAPIKeys : Get API keys for a given service or user IAM ID and account ID // Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API keys // for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of // service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space // developer in order to manage service IDs of the entity. -func (iamIdentity *IamIdentityV1) ListApiKeys(listApiKeysOptions *ListApiKeysOptions) (result *ApiKeyList, response *core.DetailedResponse, err error) { - return iamIdentity.ListApiKeysWithContext(context.Background(), listApiKeysOptions) +func (iamIdentity *IamIdentityV1) ListAPIKeys(listAPIKeysOptions *ListAPIKeysOptions) (result *APIKeyList, response *core.DetailedResponse, err error) { + return iamIdentity.ListAPIKeysWithContext(context.Background(), listAPIKeysOptions) } -// ListApiKeysWithContext is an alternate form of the ListApiKeys method which supports a Context parameter -func (iamIdentity *IamIdentityV1) ListApiKeysWithContext(ctx context.Context, listApiKeysOptions *ListApiKeysOptions) (result *ApiKeyList, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(listApiKeysOptions, "listApiKeysOptions") +// ListAPIKeysWithContext is an alternate form of the ListAPIKeys method which supports a Context parameter +func (iamIdentity *IamIdentityV1) ListAPIKeysWithContext(ctx context.Context, listAPIKeysOptions *ListAPIKeysOptions) (result *APIKeyList, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listAPIKeysOptions, "listAPIKeysOptions") if err != nil { return } @@ -169,42 +184,42 @@ func (iamIdentity *IamIdentityV1) ListApiKeysWithContext(ctx context.Context, li return } - for headerName, headerValue := range listApiKeysOptions.Headers { + for headerName, headerValue := range listAPIKeysOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "ListApiKeys") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "ListAPIKeys") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if listApiKeysOptions.AccountID != nil { - builder.AddQuery("account_id", fmt.Sprint(*listApiKeysOptions.AccountID)) + if listAPIKeysOptions.AccountID != nil { + builder.AddQuery("account_id", fmt.Sprint(*listAPIKeysOptions.AccountID)) } - if listApiKeysOptions.IamID != nil { - builder.AddQuery("iam_id", fmt.Sprint(*listApiKeysOptions.IamID)) + if listAPIKeysOptions.IamID != nil { + builder.AddQuery("iam_id", fmt.Sprint(*listAPIKeysOptions.IamID)) } - if listApiKeysOptions.Pagesize != nil { - builder.AddQuery("pagesize", fmt.Sprint(*listApiKeysOptions.Pagesize)) + if listAPIKeysOptions.Pagesize != nil { + builder.AddQuery("pagesize", fmt.Sprint(*listAPIKeysOptions.Pagesize)) } - if listApiKeysOptions.Pagetoken != nil { - builder.AddQuery("pagetoken", fmt.Sprint(*listApiKeysOptions.Pagetoken)) + if listAPIKeysOptions.Pagetoken != nil { + builder.AddQuery("pagetoken", fmt.Sprint(*listAPIKeysOptions.Pagetoken)) } - if listApiKeysOptions.Scope != nil { - builder.AddQuery("scope", fmt.Sprint(*listApiKeysOptions.Scope)) + if listAPIKeysOptions.Scope != nil { + builder.AddQuery("scope", fmt.Sprint(*listAPIKeysOptions.Scope)) } - if listApiKeysOptions.Type != nil { - builder.AddQuery("type", fmt.Sprint(*listApiKeysOptions.Type)) + if listAPIKeysOptions.Type != nil { + builder.AddQuery("type", fmt.Sprint(*listAPIKeysOptions.Type)) } - if listApiKeysOptions.Sort != nil { - builder.AddQuery("sort", fmt.Sprint(*listApiKeysOptions.Sort)) + if listAPIKeysOptions.Sort != nil { + builder.AddQuery("sort", fmt.Sprint(*listAPIKeysOptions.Sort)) } - if listApiKeysOptions.Order != nil { - builder.AddQuery("order", fmt.Sprint(*listApiKeysOptions.Order)) + if listAPIKeysOptions.Order != nil { + builder.AddQuery("order", fmt.Sprint(*listAPIKeysOptions.Order)) } - if listApiKeysOptions.IncludeHistory != nil { - builder.AddQuery("include_history", fmt.Sprint(*listApiKeysOptions.IncludeHistory)) + if listAPIKeysOptions.IncludeHistory != nil { + builder.AddQuery("include_history", fmt.Sprint(*listAPIKeysOptions.IncludeHistory)) } request, err := builder.Build() @@ -217,7 +232,7 @@ func (iamIdentity *IamIdentityV1) ListApiKeysWithContext(ctx context.Context, li if err != nil { return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalApiKeyList) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAPIKeyList) if err != nil { return } @@ -226,20 +241,20 @@ func (iamIdentity *IamIdentityV1) ListApiKeysWithContext(ctx context.Context, li return } -// CreateApiKey : Create an API key +// CreateAPIKey : Create an API key // Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys // for service IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) CreateApiKey(createApiKeyOptions *CreateApiKeyOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - return iamIdentity.CreateApiKeyWithContext(context.Background(), createApiKeyOptions) +func (iamIdentity *IamIdentityV1) CreateAPIKey(createAPIKeyOptions *CreateAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { + return iamIdentity.CreateAPIKeyWithContext(context.Background(), createAPIKeyOptions) } -// CreateApiKeyWithContext is an alternate form of the CreateApiKey method which supports a Context parameter -func (iamIdentity *IamIdentityV1) CreateApiKeyWithContext(ctx context.Context, createApiKeyOptions *CreateApiKeyOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createApiKeyOptions, "createApiKeyOptions cannot be nil") +// CreateAPIKeyWithContext is an alternate form of the CreateAPIKey method which supports a Context parameter +func (iamIdentity *IamIdentityV1) CreateAPIKeyWithContext(ctx context.Context, createAPIKeyOptions *CreateAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createAPIKeyOptions, "createAPIKeyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createApiKeyOptions, "createApiKeyOptions") + err = core.ValidateStruct(createAPIKeyOptions, "createAPIKeyOptions") if err != nil { return } @@ -252,38 +267,38 @@ func (iamIdentity *IamIdentityV1) CreateApiKeyWithContext(ctx context.Context, c return } - for headerName, headerValue := range createApiKeyOptions.Headers { + for headerName, headerValue := range createAPIKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "CreateApiKey") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "CreateAPIKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") - if createApiKeyOptions.EntityLock != nil { - builder.AddHeader("Entity-Lock", fmt.Sprint(*createApiKeyOptions.EntityLock)) + if createAPIKeyOptions.EntityLock != nil { + builder.AddHeader("Entity-Lock", fmt.Sprint(*createAPIKeyOptions.EntityLock)) } body := make(map[string]interface{}) - if createApiKeyOptions.Name != nil { - body["name"] = createApiKeyOptions.Name + if createAPIKeyOptions.Name != nil { + body["name"] = createAPIKeyOptions.Name } - if createApiKeyOptions.IamID != nil { - body["iam_id"] = createApiKeyOptions.IamID + if createAPIKeyOptions.IamID != nil { + body["iam_id"] = createAPIKeyOptions.IamID } - if createApiKeyOptions.Description != nil { - body["description"] = createApiKeyOptions.Description + if createAPIKeyOptions.Description != nil { + body["description"] = createAPIKeyOptions.Description } - if createApiKeyOptions.AccountID != nil { - body["account_id"] = createApiKeyOptions.AccountID + if createAPIKeyOptions.AccountID != nil { + body["account_id"] = createAPIKeyOptions.AccountID } - if createApiKeyOptions.Apikey != nil { - body["apikey"] = createApiKeyOptions.Apikey + if createAPIKeyOptions.Apikey != nil { + body["apikey"] = createAPIKeyOptions.Apikey } - if createApiKeyOptions.StoreValue != nil { - body["store_value"] = createApiKeyOptions.StoreValue + if createAPIKeyOptions.StoreValue != nil { + body["store_value"] = createAPIKeyOptions.StoreValue } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -300,7 +315,7 @@ func (iamIdentity *IamIdentityV1) CreateApiKeyWithContext(ctx context.Context, c if err != nil { return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalApiKey) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAPIKey) if err != nil { return } @@ -309,16 +324,16 @@ func (iamIdentity *IamIdentityV1) CreateApiKeyWithContext(ctx context.Context, c return } -// GetApiKeysDetails : Get details of an API key by its value +// GetAPIKeysDetails : Get details of an API key by its value // Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys // for service IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) GetApiKeysDetails(getApiKeysDetailsOptions *GetApiKeysDetailsOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - return iamIdentity.GetApiKeysDetailsWithContext(context.Background(), getApiKeysDetailsOptions) +func (iamIdentity *IamIdentityV1) GetAPIKeysDetails(getAPIKeysDetailsOptions *GetAPIKeysDetailsOptions) (result *APIKey, response *core.DetailedResponse, err error) { + return iamIdentity.GetAPIKeysDetailsWithContext(context.Background(), getAPIKeysDetailsOptions) } -// GetApiKeysDetailsWithContext is an alternate form of the GetApiKeysDetails method which supports a Context parameter -func (iamIdentity *IamIdentityV1) GetApiKeysDetailsWithContext(ctx context.Context, getApiKeysDetailsOptions *GetApiKeysDetailsOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(getApiKeysDetailsOptions, "getApiKeysDetailsOptions") +// GetAPIKeysDetailsWithContext is an alternate form of the GetAPIKeysDetails method which supports a Context parameter +func (iamIdentity *IamIdentityV1) GetAPIKeysDetailsWithContext(ctx context.Context, getAPIKeysDetailsOptions *GetAPIKeysDetailsOptions) (result *APIKey, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(getAPIKeysDetailsOptions, "getAPIKeysDetailsOptions") if err != nil { return } @@ -331,21 +346,21 @@ func (iamIdentity *IamIdentityV1) GetApiKeysDetailsWithContext(ctx context.Conte return } - for headerName, headerValue := range getApiKeysDetailsOptions.Headers { + for headerName, headerValue := range getAPIKeysDetailsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "GetApiKeysDetails") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "GetAPIKeysDetails") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if getApiKeysDetailsOptions.IAMApiKey != nil { - builder.AddHeader("IAM-ApiKey", fmt.Sprint(*getApiKeysDetailsOptions.IAMApiKey)) + if getAPIKeysDetailsOptions.IamAPIKey != nil { + builder.AddHeader("IAM-ApiKey", fmt.Sprint(*getAPIKeysDetailsOptions.IamAPIKey)) } - if getApiKeysDetailsOptions.IncludeHistory != nil { - builder.AddQuery("include_history", fmt.Sprint(*getApiKeysDetailsOptions.IncludeHistory)) + if getAPIKeysDetailsOptions.IncludeHistory != nil { + builder.AddQuery("include_history", fmt.Sprint(*getAPIKeysDetailsOptions.IncludeHistory)) } request, err := builder.Build() @@ -358,7 +373,7 @@ func (iamIdentity *IamIdentityV1) GetApiKeysDetailsWithContext(ctx context.Conte if err != nil { return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalApiKey) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAPIKey) if err != nil { return } @@ -367,28 +382,28 @@ func (iamIdentity *IamIdentityV1) GetApiKeysDetailsWithContext(ctx context.Conte return } -// GetApiKey : Get details of an API key +// GetAPIKey : Get details of an API key // Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service // IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be // either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the // entity. -func (iamIdentity *IamIdentityV1) GetApiKey(getApiKeyOptions *GetApiKeyOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - return iamIdentity.GetApiKeyWithContext(context.Background(), getApiKeyOptions) +func (iamIdentity *IamIdentityV1) GetAPIKey(getAPIKeyOptions *GetAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { + return iamIdentity.GetAPIKeyWithContext(context.Background(), getAPIKeyOptions) } -// GetApiKeyWithContext is an alternate form of the GetApiKey method which supports a Context parameter -func (iamIdentity *IamIdentityV1) GetApiKeyWithContext(ctx context.Context, getApiKeyOptions *GetApiKeyOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getApiKeyOptions, "getApiKeyOptions cannot be nil") +// GetAPIKeyWithContext is an alternate form of the GetAPIKey method which supports a Context parameter +func (iamIdentity *IamIdentityV1) GetAPIKeyWithContext(ctx context.Context, getAPIKeyOptions *GetAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getAPIKeyOptions, "getAPIKeyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getApiKeyOptions, "getApiKeyOptions") + err = core.ValidateStruct(getAPIKeyOptions, "getAPIKeyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getApiKeyOptions.ID, + "id": *getAPIKeyOptions.ID, } builder := core.NewRequestBuilder(core.GET) @@ -399,18 +414,18 @@ func (iamIdentity *IamIdentityV1) GetApiKeyWithContext(ctx context.Context, getA return } - for headerName, headerValue := range getApiKeyOptions.Headers { + for headerName, headerValue := range getAPIKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "GetApiKey") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "GetAPIKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if getApiKeyOptions.IncludeHistory != nil { - builder.AddQuery("include_history", fmt.Sprint(*getApiKeyOptions.IncludeHistory)) + if getAPIKeyOptions.IncludeHistory != nil { + builder.AddQuery("include_history", fmt.Sprint(*getAPIKeyOptions.IncludeHistory)) } request, err := builder.Build() @@ -423,7 +438,7 @@ func (iamIdentity *IamIdentityV1) GetApiKeyWithContext(ctx context.Context, getA if err != nil { return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalApiKey) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAPIKey) if err != nil { return } @@ -432,28 +447,28 @@ func (iamIdentity *IamIdentityV1) GetApiKeyWithContext(ctx context.Context, getA return } -// UpdateApiKey : Updates an API key +// UpdateAPIKey : Updates an API key // Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay // unchanged until the access token is refreshed. To update an API key, pass the property to be modified. To delete one // property's value, pass the property with an empty value "".Users can manage user API keys for themself, or service ID // API keys for service IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) UpdateApiKey(updateApiKeyOptions *UpdateApiKeyOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - return iamIdentity.UpdateApiKeyWithContext(context.Background(), updateApiKeyOptions) +func (iamIdentity *IamIdentityV1) UpdateAPIKey(updateAPIKeyOptions *UpdateAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { + return iamIdentity.UpdateAPIKeyWithContext(context.Background(), updateAPIKeyOptions) } -// UpdateApiKeyWithContext is an alternate form of the UpdateApiKey method which supports a Context parameter -func (iamIdentity *IamIdentityV1) UpdateApiKeyWithContext(ctx context.Context, updateApiKeyOptions *UpdateApiKeyOptions) (result *ApiKey, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateApiKeyOptions, "updateApiKeyOptions cannot be nil") +// UpdateAPIKeyWithContext is an alternate form of the UpdateAPIKey method which supports a Context parameter +func (iamIdentity *IamIdentityV1) UpdateAPIKeyWithContext(ctx context.Context, updateAPIKeyOptions *UpdateAPIKeyOptions) (result *APIKey, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateAPIKeyOptions, "updateAPIKeyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateApiKeyOptions, "updateApiKeyOptions") + err = core.ValidateStruct(updateAPIKeyOptions, "updateAPIKeyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateApiKeyOptions.ID, + "id": *updateAPIKeyOptions.ID, } builder := core.NewRequestBuilder(core.PUT) @@ -464,26 +479,26 @@ func (iamIdentity *IamIdentityV1) UpdateApiKeyWithContext(ctx context.Context, u return } - for headerName, headerValue := range updateApiKeyOptions.Headers { + for headerName, headerValue := range updateAPIKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "UpdateApiKey") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "UpdateAPIKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") - if updateApiKeyOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateApiKeyOptions.IfMatch)) + if updateAPIKeyOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateAPIKeyOptions.IfMatch)) } body := make(map[string]interface{}) - if updateApiKeyOptions.Name != nil { - body["name"] = updateApiKeyOptions.Name + if updateAPIKeyOptions.Name != nil { + body["name"] = updateAPIKeyOptions.Name } - if updateApiKeyOptions.Description != nil { - body["description"] = updateApiKeyOptions.Description + if updateAPIKeyOptions.Description != nil { + body["description"] = updateAPIKeyOptions.Description } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -500,7 +515,7 @@ func (iamIdentity *IamIdentityV1) UpdateApiKeyWithContext(ctx context.Context, u if err != nil { return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalApiKey) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalAPIKey) if err != nil { return } @@ -509,27 +524,27 @@ func (iamIdentity *IamIdentityV1) UpdateApiKeyWithContext(ctx context.Context, u return } -// DeleteApiKey : Deletes an API key +// DeleteAPIKey : Deletes an API key // Deletes an API key. Existing tokens will remain valid until expired. Refresh tokens will not work any more for this // API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an // entity they have access to. -func (iamIdentity *IamIdentityV1) DeleteApiKey(deleteApiKeyOptions *DeleteApiKeyOptions) (response *core.DetailedResponse, err error) { - return iamIdentity.DeleteApiKeyWithContext(context.Background(), deleteApiKeyOptions) +func (iamIdentity *IamIdentityV1) DeleteAPIKey(deleteAPIKeyOptions *DeleteAPIKeyOptions) (response *core.DetailedResponse, err error) { + return iamIdentity.DeleteAPIKeyWithContext(context.Background(), deleteAPIKeyOptions) } -// DeleteApiKeyWithContext is an alternate form of the DeleteApiKey method which supports a Context parameter -func (iamIdentity *IamIdentityV1) DeleteApiKeyWithContext(ctx context.Context, deleteApiKeyOptions *DeleteApiKeyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteApiKeyOptions, "deleteApiKeyOptions cannot be nil") +// DeleteAPIKeyWithContext is an alternate form of the DeleteAPIKey method which supports a Context parameter +func (iamIdentity *IamIdentityV1) DeleteAPIKeyWithContext(ctx context.Context, deleteAPIKeyOptions *DeleteAPIKeyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteAPIKeyOptions, "deleteAPIKeyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteApiKeyOptions, "deleteApiKeyOptions") + err = core.ValidateStruct(deleteAPIKeyOptions, "deleteAPIKeyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteApiKeyOptions.ID, + "id": *deleteAPIKeyOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) @@ -540,11 +555,11 @@ func (iamIdentity *IamIdentityV1) DeleteApiKeyWithContext(ctx context.Context, d return } - for headerName, headerValue := range deleteApiKeyOptions.Headers { + for headerName, headerValue := range deleteAPIKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "DeleteApiKey") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "DeleteAPIKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -559,27 +574,27 @@ func (iamIdentity *IamIdentityV1) DeleteApiKeyWithContext(ctx context.Context, d return } -// LockApiKey : Lock the API key +// LockAPIKey : Lock the API key // Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are // bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account // owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. -func (iamIdentity *IamIdentityV1) LockApiKey(lockApiKeyOptions *LockApiKeyOptions) (response *core.DetailedResponse, err error) { - return iamIdentity.LockApiKeyWithContext(context.Background(), lockApiKeyOptions) +func (iamIdentity *IamIdentityV1) LockAPIKey(lockAPIKeyOptions *LockAPIKeyOptions) (response *core.DetailedResponse, err error) { + return iamIdentity.LockAPIKeyWithContext(context.Background(), lockAPIKeyOptions) } -// LockApiKeyWithContext is an alternate form of the LockApiKey method which supports a Context parameter -func (iamIdentity *IamIdentityV1) LockApiKeyWithContext(ctx context.Context, lockApiKeyOptions *LockApiKeyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(lockApiKeyOptions, "lockApiKeyOptions cannot be nil") +// LockAPIKeyWithContext is an alternate form of the LockAPIKey method which supports a Context parameter +func (iamIdentity *IamIdentityV1) LockAPIKeyWithContext(ctx context.Context, lockAPIKeyOptions *LockAPIKeyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(lockAPIKeyOptions, "lockAPIKeyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(lockApiKeyOptions, "lockApiKeyOptions") + err = core.ValidateStruct(lockAPIKeyOptions, "lockAPIKeyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *lockApiKeyOptions.ID, + "id": *lockAPIKeyOptions.ID, } builder := core.NewRequestBuilder(core.POST) @@ -590,11 +605,11 @@ func (iamIdentity *IamIdentityV1) LockApiKeyWithContext(ctx context.Context, loc return } - for headerName, headerValue := range lockApiKeyOptions.Headers { + for headerName, headerValue := range lockAPIKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "LockApiKey") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "LockAPIKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -609,27 +624,27 @@ func (iamIdentity *IamIdentityV1) LockApiKeyWithContext(ctx context.Context, loc return } -// UnlockApiKey : Unlock the API key +// UnlockAPIKey : Unlock the API key // Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that // are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an // account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. -func (iamIdentity *IamIdentityV1) UnlockApiKey(unlockApiKeyOptions *UnlockApiKeyOptions) (response *core.DetailedResponse, err error) { - return iamIdentity.UnlockApiKeyWithContext(context.Background(), unlockApiKeyOptions) +func (iamIdentity *IamIdentityV1) UnlockAPIKey(unlockAPIKeyOptions *UnlockAPIKeyOptions) (response *core.DetailedResponse, err error) { + return iamIdentity.UnlockAPIKeyWithContext(context.Background(), unlockAPIKeyOptions) } -// UnlockApiKeyWithContext is an alternate form of the UnlockApiKey method which supports a Context parameter -func (iamIdentity *IamIdentityV1) UnlockApiKeyWithContext(ctx context.Context, unlockApiKeyOptions *UnlockApiKeyOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(unlockApiKeyOptions, "unlockApiKeyOptions cannot be nil") +// UnlockAPIKeyWithContext is an alternate form of the UnlockAPIKey method which supports a Context parameter +func (iamIdentity *IamIdentityV1) UnlockAPIKeyWithContext(ctx context.Context, unlockAPIKeyOptions *UnlockAPIKeyOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(unlockAPIKeyOptions, "unlockAPIKeyOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(unlockApiKeyOptions, "unlockApiKeyOptions") + err = core.ValidateStruct(unlockAPIKeyOptions, "unlockAPIKeyOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *unlockApiKeyOptions.ID, + "id": *unlockAPIKeyOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) @@ -640,11 +655,11 @@ func (iamIdentity *IamIdentityV1) UnlockApiKeyWithContext(ctx context.Context, u return } - for headerName, headerValue := range unlockApiKeyOptions.Headers { + for headerName, headerValue := range unlockAPIKeyOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "UnlockApiKey") + sdkHeaders := common.GetSdkHeaders("iam_identity", "V1", "UnlockAPIKey") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } @@ -662,12 +677,12 @@ func (iamIdentity *IamIdentityV1) UnlockApiKeyWithContext(ctx context.Context, u // ListServiceIds : List service IDs // Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs // that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) ListServiceIds(listServiceIdsOptions *ListServiceIdsOptions) (result *ServiceIdList, response *core.DetailedResponse, err error) { +func (iamIdentity *IamIdentityV1) ListServiceIds(listServiceIdsOptions *ListServiceIdsOptions) (result *ServiceIDList, response *core.DetailedResponse, err error) { return iamIdentity.ListServiceIdsWithContext(context.Background(), listServiceIdsOptions) } // ListServiceIdsWithContext is an alternate form of the ListServiceIds method which supports a Context parameter -func (iamIdentity *IamIdentityV1) ListServiceIdsWithContext(ctx context.Context, listServiceIdsOptions *ListServiceIdsOptions) (result *ServiceIdList, response *core.DetailedResponse, err error) { +func (iamIdentity *IamIdentityV1) ListServiceIdsWithContext(ctx context.Context, listServiceIdsOptions *ListServiceIdsOptions) (result *ServiceIDList, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listServiceIdsOptions, "listServiceIdsOptions") if err != nil { return @@ -723,7 +738,7 @@ func (iamIdentity *IamIdentityV1) ListServiceIdsWithContext(ctx context.Context, if err != nil { return } - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalServiceIdList) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalServiceIDList) if err != nil { return } @@ -735,17 +750,17 @@ func (iamIdentity *IamIdentityV1) ListServiceIdsWithContext(ctx context.Context, // CreateServiceID : Create a service ID // Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys // for service IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) CreateServiceID(createServiceIdOptions *CreateServiceIdOptions) (result *ServiceID, response *core.DetailedResponse, err error) { - return iamIdentity.CreateServiceIDWithContext(context.Background(), createServiceIdOptions) +func (iamIdentity *IamIdentityV1) CreateServiceID(createServiceIDOptions *CreateServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { + return iamIdentity.CreateServiceIDWithContext(context.Background(), createServiceIDOptions) } // CreateServiceIDWithContext is an alternate form of the CreateServiceID method which supports a Context parameter -func (iamIdentity *IamIdentityV1) CreateServiceIDWithContext(ctx context.Context, createServiceIdOptions *CreateServiceIdOptions) (result *ServiceID, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(createServiceIdOptions, "createServiceIdOptions cannot be nil") +func (iamIdentity *IamIdentityV1) CreateServiceIDWithContext(ctx context.Context, createServiceIDOptions *CreateServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createServiceIDOptions, "createServiceIDOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(createServiceIdOptions, "createServiceIdOptions") + err = core.ValidateStruct(createServiceIDOptions, "createServiceIDOptions") if err != nil { return } @@ -758,7 +773,7 @@ func (iamIdentity *IamIdentityV1) CreateServiceIDWithContext(ctx context.Context return } - for headerName, headerValue := range createServiceIdOptions.Headers { + for headerName, headerValue := range createServiceIDOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -768,25 +783,25 @@ func (iamIdentity *IamIdentityV1) CreateServiceIDWithContext(ctx context.Context } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") - if createServiceIdOptions.EntityLock != nil { - builder.AddHeader("Entity-Lock", fmt.Sprint(*createServiceIdOptions.EntityLock)) + if createServiceIDOptions.EntityLock != nil { + builder.AddHeader("Entity-Lock", fmt.Sprint(*createServiceIDOptions.EntityLock)) } body := make(map[string]interface{}) - if createServiceIdOptions.AccountID != nil { - body["account_id"] = createServiceIdOptions.AccountID + if createServiceIDOptions.AccountID != nil { + body["account_id"] = createServiceIDOptions.AccountID } - if createServiceIdOptions.Name != nil { - body["name"] = createServiceIdOptions.Name + if createServiceIDOptions.Name != nil { + body["name"] = createServiceIDOptions.Name } - if createServiceIdOptions.Description != nil { - body["description"] = createServiceIdOptions.Description + if createServiceIDOptions.Description != nil { + body["description"] = createServiceIDOptions.Description } - if createServiceIdOptions.UniqueInstanceCrns != nil { - body["unique_instance_crns"] = createServiceIdOptions.UniqueInstanceCrns + if createServiceIDOptions.UniqueInstanceCrns != nil { + body["unique_instance_crns"] = createServiceIDOptions.UniqueInstanceCrns } - if createServiceIdOptions.Apikey != nil { - body["apikey"] = createServiceIdOptions.Apikey + if createServiceIDOptions.Apikey != nil { + body["apikey"] = createServiceIDOptions.Apikey } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -815,23 +830,23 @@ func (iamIdentity *IamIdentityV1) CreateServiceIDWithContext(ctx context.Context // GetServiceID : Get details of a service ID // Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service // IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) GetServiceID(getServiceIdOptions *GetServiceIdOptions) (result *ServiceID, response *core.DetailedResponse, err error) { - return iamIdentity.GetServiceIDWithContext(context.Background(), getServiceIdOptions) +func (iamIdentity *IamIdentityV1) GetServiceID(getServiceIDOptions *GetServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { + return iamIdentity.GetServiceIDWithContext(context.Background(), getServiceIDOptions) } // GetServiceIDWithContext is an alternate form of the GetServiceID method which supports a Context parameter -func (iamIdentity *IamIdentityV1) GetServiceIDWithContext(ctx context.Context, getServiceIdOptions *GetServiceIdOptions) (result *ServiceID, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getServiceIdOptions, "getServiceIdOptions cannot be nil") +func (iamIdentity *IamIdentityV1) GetServiceIDWithContext(ctx context.Context, getServiceIDOptions *GetServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getServiceIDOptions, "getServiceIDOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getServiceIdOptions, "getServiceIdOptions") + err = core.ValidateStruct(getServiceIDOptions, "getServiceIDOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *getServiceIdOptions.ID, + "id": *getServiceIDOptions.ID, } builder := core.NewRequestBuilder(core.GET) @@ -842,7 +857,7 @@ func (iamIdentity *IamIdentityV1) GetServiceIDWithContext(ctx context.Context, g return } - for headerName, headerValue := range getServiceIdOptions.Headers { + for headerName, headerValue := range getServiceIDOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -852,8 +867,8 @@ func (iamIdentity *IamIdentityV1) GetServiceIDWithContext(ctx context.Context, g } builder.AddHeader("Accept", "application/json") - if getServiceIdOptions.IncludeHistory != nil { - builder.AddQuery("include_history", fmt.Sprint(*getServiceIdOptions.IncludeHistory)) + if getServiceIDOptions.IncludeHistory != nil { + builder.AddQuery("include_history", fmt.Sprint(*getServiceIDOptions.IncludeHistory)) } request, err := builder.Build() @@ -880,23 +895,23 @@ func (iamIdentity *IamIdentityV1) GetServiceIDWithContext(ctx context.Context, g // unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete // one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or // service ID API keys for service IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) UpdateServiceID(updateServiceIdOptions *UpdateServiceIdOptions) (result *ServiceID, response *core.DetailedResponse, err error) { - return iamIdentity.UpdateServiceIDWithContext(context.Background(), updateServiceIdOptions) +func (iamIdentity *IamIdentityV1) UpdateServiceID(updateServiceIDOptions *UpdateServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { + return iamIdentity.UpdateServiceIDWithContext(context.Background(), updateServiceIDOptions) } // UpdateServiceIDWithContext is an alternate form of the UpdateServiceID method which supports a Context parameter -func (iamIdentity *IamIdentityV1) UpdateServiceIDWithContext(ctx context.Context, updateServiceIdOptions *UpdateServiceIdOptions) (result *ServiceID, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateServiceIdOptions, "updateServiceIdOptions cannot be nil") +func (iamIdentity *IamIdentityV1) UpdateServiceIDWithContext(ctx context.Context, updateServiceIDOptions *UpdateServiceIDOptions) (result *ServiceID, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateServiceIDOptions, "updateServiceIDOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateServiceIdOptions, "updateServiceIdOptions") + err = core.ValidateStruct(updateServiceIDOptions, "updateServiceIDOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *updateServiceIdOptions.ID, + "id": *updateServiceIDOptions.ID, } builder := core.NewRequestBuilder(core.PUT) @@ -907,7 +922,7 @@ func (iamIdentity *IamIdentityV1) UpdateServiceIDWithContext(ctx context.Context return } - for headerName, headerValue := range updateServiceIdOptions.Headers { + for headerName, headerValue := range updateServiceIDOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -917,19 +932,19 @@ func (iamIdentity *IamIdentityV1) UpdateServiceIDWithContext(ctx context.Context } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") - if updateServiceIdOptions.IfMatch != nil { - builder.AddHeader("If-Match", fmt.Sprint(*updateServiceIdOptions.IfMatch)) + if updateServiceIDOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateServiceIDOptions.IfMatch)) } body := make(map[string]interface{}) - if updateServiceIdOptions.Name != nil { - body["name"] = updateServiceIdOptions.Name + if updateServiceIDOptions.Name != nil { + body["name"] = updateServiceIDOptions.Name } - if updateServiceIdOptions.Description != nil { - body["description"] = updateServiceIdOptions.Description + if updateServiceIDOptions.Description != nil { + body["description"] = updateServiceIDOptions.Description } - if updateServiceIdOptions.UniqueInstanceCrns != nil { - body["unique_instance_crns"] = updateServiceIdOptions.UniqueInstanceCrns + if updateServiceIDOptions.UniqueInstanceCrns != nil { + body["unique_instance_crns"] = updateServiceIDOptions.UniqueInstanceCrns } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -960,23 +975,23 @@ func (iamIdentity *IamIdentityV1) UpdateServiceIDWithContext(ctx context.Context // deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only // deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself, or // service ID API keys for service IDs that are bound to an entity they have access to. -func (iamIdentity *IamIdentityV1) DeleteServiceID(deleteServiceIdOptions *DeleteServiceIdOptions) (response *core.DetailedResponse, err error) { - return iamIdentity.DeleteServiceIDWithContext(context.Background(), deleteServiceIdOptions) +func (iamIdentity *IamIdentityV1) DeleteServiceID(deleteServiceIDOptions *DeleteServiceIDOptions) (response *core.DetailedResponse, err error) { + return iamIdentity.DeleteServiceIDWithContext(context.Background(), deleteServiceIDOptions) } // DeleteServiceIDWithContext is an alternate form of the DeleteServiceID method which supports a Context parameter -func (iamIdentity *IamIdentityV1) DeleteServiceIDWithContext(ctx context.Context, deleteServiceIdOptions *DeleteServiceIdOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteServiceIdOptions, "deleteServiceIdOptions cannot be nil") +func (iamIdentity *IamIdentityV1) DeleteServiceIDWithContext(ctx context.Context, deleteServiceIDOptions *DeleteServiceIDOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteServiceIDOptions, "deleteServiceIDOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteServiceIdOptions, "deleteServiceIdOptions") + err = core.ValidateStruct(deleteServiceIDOptions, "deleteServiceIDOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *deleteServiceIdOptions.ID, + "id": *deleteServiceIDOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) @@ -987,7 +1002,7 @@ func (iamIdentity *IamIdentityV1) DeleteServiceIDWithContext(ctx context.Context return } - for headerName, headerValue := range deleteServiceIdOptions.Headers { + for headerName, headerValue := range deleteServiceIDOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1010,23 +1025,23 @@ func (iamIdentity *IamIdentityV1) DeleteServiceIDWithContext(ctx context.Context // Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that // are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an // account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. -func (iamIdentity *IamIdentityV1) LockServiceID(lockServiceIdOptions *LockServiceIdOptions) (response *core.DetailedResponse, err error) { - return iamIdentity.LockServiceIDWithContext(context.Background(), lockServiceIdOptions) +func (iamIdentity *IamIdentityV1) LockServiceID(lockServiceIDOptions *LockServiceIDOptions) (response *core.DetailedResponse, err error) { + return iamIdentity.LockServiceIDWithContext(context.Background(), lockServiceIDOptions) } // LockServiceIDWithContext is an alternate form of the LockServiceID method which supports a Context parameter -func (iamIdentity *IamIdentityV1) LockServiceIDWithContext(ctx context.Context, lockServiceIdOptions *LockServiceIdOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(lockServiceIdOptions, "lockServiceIdOptions cannot be nil") +func (iamIdentity *IamIdentityV1) LockServiceIDWithContext(ctx context.Context, lockServiceIDOptions *LockServiceIDOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(lockServiceIDOptions, "lockServiceIDOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(lockServiceIdOptions, "lockServiceIdOptions") + err = core.ValidateStruct(lockServiceIDOptions, "lockServiceIDOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *lockServiceIdOptions.ID, + "id": *lockServiceIDOptions.ID, } builder := core.NewRequestBuilder(core.POST) @@ -1037,7 +1052,7 @@ func (iamIdentity *IamIdentityV1) LockServiceIDWithContext(ctx context.Context, return } - for headerName, headerValue := range lockServiceIdOptions.Headers { + for headerName, headerValue := range lockServiceIDOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1060,23 +1075,23 @@ func (iamIdentity *IamIdentityV1) LockServiceIDWithContext(ctx context.Context, // Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that // are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an // account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. -func (iamIdentity *IamIdentityV1) UnlockServiceID(unlockServiceIdOptions *UnlockServiceIdOptions) (response *core.DetailedResponse, err error) { - return iamIdentity.UnlockServiceIDWithContext(context.Background(), unlockServiceIdOptions) +func (iamIdentity *IamIdentityV1) UnlockServiceID(unlockServiceIDOptions *UnlockServiceIDOptions) (response *core.DetailedResponse, err error) { + return iamIdentity.UnlockServiceIDWithContext(context.Background(), unlockServiceIDOptions) } // UnlockServiceIDWithContext is an alternate form of the UnlockServiceID method which supports a Context parameter -func (iamIdentity *IamIdentityV1) UnlockServiceIDWithContext(ctx context.Context, unlockServiceIdOptions *UnlockServiceIdOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(unlockServiceIdOptions, "unlockServiceIdOptions cannot be nil") +func (iamIdentity *IamIdentityV1) UnlockServiceIDWithContext(ctx context.Context, unlockServiceIDOptions *UnlockServiceIDOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(unlockServiceIDOptions, "unlockServiceIDOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(unlockServiceIdOptions, "unlockServiceIdOptions") + err = core.ValidateStruct(unlockServiceIDOptions, "unlockServiceIDOptions") if err != nil { return } pathParamsMap := map[string]string{ - "id": *unlockServiceIdOptions.ID, + "id": *unlockServiceIDOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) @@ -1087,7 +1102,7 @@ func (iamIdentity *IamIdentityV1) UnlockServiceIDWithContext(ctx context.Context return } - for headerName, headerValue := range unlockServiceIdOptions.Headers { + for headerName, headerValue := range unlockServiceIDOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1106,8 +1121,8 @@ func (iamIdentity *IamIdentityV1) UnlockServiceIDWithContext(ctx context.Context return } -// ApiKey : Response body format for API key V1 REST requests. -type ApiKey struct { +// APIKey : Response body format for API key V1 REST requests. +type APIKey struct { // Context with key properties for problem determination. Context *ResponseContext `json:"context,omitempty"` @@ -1120,7 +1135,7 @@ type ApiKey struct { // Cloud Resource Name of the item. Example Cloud Resource Name: // 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678'. - Crn *string `json:"crn" validate:"required"` + CRN *string `json:"crn" validate:"required"` // The API key cannot be changed if set to true. Locked *bool `json:"locked" validate:"required"` @@ -1159,9 +1174,9 @@ type ApiKey struct { } -// UnmarshalApiKey unmarshals an instance of ApiKey from the specified map of raw messages. -func UnmarshalApiKey(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ApiKey) +// UnmarshalAPIKey unmarshals an instance of APIKey from the specified map of raw messages. +func UnmarshalAPIKey(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(APIKey) err = core.UnmarshalModel(m, "context", &obj.Context, UnmarshalResponseContext) if err != nil { return @@ -1174,7 +1189,7 @@ func UnmarshalApiKey(m map[string]json.RawMessage, result interface{}) (err erro if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -1222,8 +1237,8 @@ func UnmarshalApiKey(m map[string]json.RawMessage, result interface{}) (err erro return } -// ApiKeyInsideCreateServiceIdRequest : Parameters for the API key in the Create service Id V1 REST request. -type ApiKeyInsideCreateServiceIdRequest struct { +// APIKeyInsideCreateServiceIDRequest : Parameters for the API key in the Create service Id V1 REST request. +type APIKeyInsideCreateServiceIDRequest struct { // Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. // Access is done via the UUID of the API key. Name *string `json:"name" validate:"required"` @@ -1245,18 +1260,18 @@ type ApiKeyInsideCreateServiceIdRequest struct { } -// NewApiKeyInsideCreateServiceIdRequest : Instantiate ApiKeyInsideCreateServiceIdRequest (Generic Model Constructor) -func (*IamIdentityV1) NewApiKeyInsideCreateServiceIdRequest(name string) (model *ApiKeyInsideCreateServiceIdRequest, err error) { - model = &ApiKeyInsideCreateServiceIdRequest{ +// NewAPIKeyInsideCreateServiceIDRequest : Instantiate APIKeyInsideCreateServiceIDRequest (Generic Model Constructor) +func (*IamIdentityV1) NewAPIKeyInsideCreateServiceIDRequest(name string) (model *APIKeyInsideCreateServiceIDRequest, err error) { + model = &APIKeyInsideCreateServiceIDRequest{ Name: core.StringPtr(name), } err = core.ValidateStruct(model, "required parameters") return } -// UnmarshalApiKeyInsideCreateServiceIdRequest unmarshals an instance of ApiKeyInsideCreateServiceIdRequest from the specified map of raw messages. -func UnmarshalApiKeyInsideCreateServiceIdRequest(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ApiKeyInsideCreateServiceIdRequest) +// UnmarshalAPIKeyInsideCreateServiceIDRequest unmarshals an instance of APIKeyInsideCreateServiceIDRequest from the specified map of raw messages. +func UnmarshalAPIKeyInsideCreateServiceIDRequest(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(APIKeyInsideCreateServiceIDRequest) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return @@ -1277,8 +1292,8 @@ func UnmarshalApiKeyInsideCreateServiceIdRequest(m map[string]json.RawMessage, r return } -// ApiKeyList : Response body format for the List API keys V1 REST request. -type ApiKeyList struct { +// APIKeyList : Response body format for the List API keys V1 REST request. +type APIKeyList struct { // Context with key properties for problem determination. Context *ResponseContext `json:"context,omitempty"` @@ -1300,13 +1315,13 @@ type ApiKeyList struct { // List of API keys based on the query paramters and the page size. The apikeys array is always part of the response // but might be empty depending on the query parameters values provided. - Apikeys []ApiKey `json:"apikeys" validate:"required"` + Apikeys []APIKey `json:"apikeys" validate:"required"` } -// UnmarshalApiKeyList unmarshals an instance of ApiKeyList from the specified map of raw messages. -func UnmarshalApiKeyList(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ApiKeyList) +// UnmarshalAPIKeyList unmarshals an instance of APIKeyList from the specified map of raw messages. +func UnmarshalAPIKeyList(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(APIKeyList) err = core.UnmarshalModel(m, "context", &obj.Context, UnmarshalResponseContext) if err != nil { return @@ -1331,7 +1346,7 @@ func UnmarshalApiKeyList(m map[string]json.RawMessage, result interface{}) (err if err != nil { return } - err = core.UnmarshalModel(m, "apikeys", &obj.Apikeys, UnmarshalApiKey) + err = core.UnmarshalModel(m, "apikeys", &obj.Apikeys, UnmarshalAPIKey) if err != nil { return } @@ -1339,8 +1354,8 @@ func UnmarshalApiKeyList(m map[string]json.RawMessage, result interface{}) (err return } -// CreateApiKeyOptions : The CreateApiKey options. -type CreateApiKeyOptions struct { +// CreateAPIKeyOptions : The CreateAPIKey options. +type CreateAPIKeyOptions struct { // Name of the API key. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. // Access is done via the UUID of the API key. Name *string `json:"name" validate:"required"` @@ -1373,64 +1388,64 @@ type CreateApiKeyOptions struct { Headers map[string]string } -// NewCreateApiKeyOptions : Instantiate CreateApiKeyOptions -func (*IamIdentityV1) NewCreateApiKeyOptions(name string, iamID string) *CreateApiKeyOptions { - return &CreateApiKeyOptions{ +// NewCreateAPIKeyOptions : Instantiate CreateAPIKeyOptions +func (*IamIdentityV1) NewCreateAPIKeyOptions(name string, iamID string) *CreateAPIKeyOptions { + return &CreateAPIKeyOptions{ Name: core.StringPtr(name), IamID: core.StringPtr(iamID), } } // SetName : Allow user to set Name -func (options *CreateApiKeyOptions) SetName(name string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetName(name string) *CreateAPIKeyOptions { options.Name = core.StringPtr(name) return options } // SetIamID : Allow user to set IamID -func (options *CreateApiKeyOptions) SetIamID(iamID string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetIamID(iamID string) *CreateAPIKeyOptions { options.IamID = core.StringPtr(iamID) return options } // SetDescription : Allow user to set Description -func (options *CreateApiKeyOptions) SetDescription(description string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetDescription(description string) *CreateAPIKeyOptions { options.Description = core.StringPtr(description) return options } // SetAccountID : Allow user to set AccountID -func (options *CreateApiKeyOptions) SetAccountID(accountID string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetAccountID(accountID string) *CreateAPIKeyOptions { options.AccountID = core.StringPtr(accountID) return options } // SetApikey : Allow user to set Apikey -func (options *CreateApiKeyOptions) SetApikey(apikey string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetApikey(apikey string) *CreateAPIKeyOptions { options.Apikey = core.StringPtr(apikey) return options } // SetStoreValue : Allow user to set StoreValue -func (options *CreateApiKeyOptions) SetStoreValue(storeValue bool) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetStoreValue(storeValue bool) *CreateAPIKeyOptions { options.StoreValue = core.BoolPtr(storeValue) return options } // SetEntityLock : Allow user to set EntityLock -func (options *CreateApiKeyOptions) SetEntityLock(entityLock string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetEntityLock(entityLock string) *CreateAPIKeyOptions { options.EntityLock = core.StringPtr(entityLock) return options } // SetHeaders : Allow user to set Headers -func (options *CreateApiKeyOptions) SetHeaders(param map[string]string) *CreateApiKeyOptions { +func (options *CreateAPIKeyOptions) SetHeaders(param map[string]string) *CreateAPIKeyOptions { options.Headers = param return options } -// CreateServiceIdOptions : The CreateServiceID options. -type CreateServiceIdOptions struct { +// CreateServiceIDOptions : The CreateServiceID options. +type CreateServiceIDOptions struct { // ID of the account the service ID belongs to. AccountID *string `json:"account_id" validate:"required"` @@ -1446,7 +1461,7 @@ type CreateServiceIdOptions struct { UniqueInstanceCrns []string `json:"unique_instance_crns,omitempty"` // Parameters for the API key in the Create service Id V1 REST request. - Apikey *ApiKeyInsideCreateServiceIdRequest `json:"apikey,omitempty"` + Apikey *APIKeyInsideCreateServiceIDRequest `json:"apikey,omitempty"` // Indicates if the service ID is locked for further write operations. False by default. EntityLock *string `json:"Entity-Lock,omitempty"` @@ -1455,58 +1470,58 @@ type CreateServiceIdOptions struct { Headers map[string]string } -// NewCreateServiceIdOptions : Instantiate CreateServiceIdOptions -func (*IamIdentityV1) NewCreateServiceIdOptions(accountID string, name string) *CreateServiceIdOptions { - return &CreateServiceIdOptions{ +// NewCreateServiceIDOptions : Instantiate CreateServiceIDOptions +func (*IamIdentityV1) NewCreateServiceIDOptions(accountID string, name string) *CreateServiceIDOptions { + return &CreateServiceIDOptions{ AccountID: core.StringPtr(accountID), Name: core.StringPtr(name), } } // SetAccountID : Allow user to set AccountID -func (options *CreateServiceIdOptions) SetAccountID(accountID string) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetAccountID(accountID string) *CreateServiceIDOptions { options.AccountID = core.StringPtr(accountID) return options } // SetName : Allow user to set Name -func (options *CreateServiceIdOptions) SetName(name string) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetName(name string) *CreateServiceIDOptions { options.Name = core.StringPtr(name) return options } // SetDescription : Allow user to set Description -func (options *CreateServiceIdOptions) SetDescription(description string) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetDescription(description string) *CreateServiceIDOptions { options.Description = core.StringPtr(description) return options } // SetUniqueInstanceCrns : Allow user to set UniqueInstanceCrns -func (options *CreateServiceIdOptions) SetUniqueInstanceCrns(uniqueInstanceCrns []string) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetUniqueInstanceCrns(uniqueInstanceCrns []string) *CreateServiceIDOptions { options.UniqueInstanceCrns = uniqueInstanceCrns return options } // SetApikey : Allow user to set Apikey -func (options *CreateServiceIdOptions) SetApikey(apikey *ApiKeyInsideCreateServiceIdRequest) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetApikey(apikey *APIKeyInsideCreateServiceIDRequest) *CreateServiceIDOptions { options.Apikey = apikey return options } // SetEntityLock : Allow user to set EntityLock -func (options *CreateServiceIdOptions) SetEntityLock(entityLock string) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetEntityLock(entityLock string) *CreateServiceIDOptions { options.EntityLock = core.StringPtr(entityLock) return options } // SetHeaders : Allow user to set Headers -func (options *CreateServiceIdOptions) SetHeaders(param map[string]string) *CreateServiceIdOptions { +func (options *CreateServiceIDOptions) SetHeaders(param map[string]string) *CreateServiceIDOptions { options.Headers = param return options } -// DeleteApiKeyOptions : The DeleteApiKey options. -type DeleteApiKeyOptions struct { +// DeleteAPIKeyOptions : The DeleteAPIKey options. +type DeleteAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` @@ -1514,27 +1529,27 @@ type DeleteApiKeyOptions struct { Headers map[string]string } -// NewDeleteApiKeyOptions : Instantiate DeleteApiKeyOptions -func (*IamIdentityV1) NewDeleteApiKeyOptions(id string) *DeleteApiKeyOptions { - return &DeleteApiKeyOptions{ +// NewDeleteAPIKeyOptions : Instantiate DeleteAPIKeyOptions +func (*IamIdentityV1) NewDeleteAPIKeyOptions(id string) *DeleteAPIKeyOptions { + return &DeleteAPIKeyOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *DeleteApiKeyOptions) SetID(id string) *DeleteApiKeyOptions { +func (options *DeleteAPIKeyOptions) SetID(id string) *DeleteAPIKeyOptions { options.ID = core.StringPtr(id) return options } // SetHeaders : Allow user to set Headers -func (options *DeleteApiKeyOptions) SetHeaders(param map[string]string) *DeleteApiKeyOptions { +func (options *DeleteAPIKeyOptions) SetHeaders(param map[string]string) *DeleteAPIKeyOptions { options.Headers = param return options } -// DeleteServiceIdOptions : The DeleteServiceID options. -type DeleteServiceIdOptions struct { +// DeleteServiceIDOptions : The DeleteServiceID options. +type DeleteServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` @@ -1542,21 +1557,21 @@ type DeleteServiceIdOptions struct { Headers map[string]string } -// NewDeleteServiceIdOptions : Instantiate DeleteServiceIdOptions -func (*IamIdentityV1) NewDeleteServiceIdOptions(id string) *DeleteServiceIdOptions { - return &DeleteServiceIdOptions{ +// NewDeleteServiceIDOptions : Instantiate DeleteServiceIDOptions +func (*IamIdentityV1) NewDeleteServiceIDOptions(id string) *DeleteServiceIDOptions { + return &DeleteServiceIDOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *DeleteServiceIdOptions) SetID(id string) *DeleteServiceIdOptions { +func (options *DeleteServiceIDOptions) SetID(id string) *DeleteServiceIDOptions { options.ID = core.StringPtr(id) return options } // SetHeaders : Allow user to set Headers -func (options *DeleteServiceIdOptions) SetHeaders(param map[string]string) *DeleteServiceIdOptions { +func (options *DeleteServiceIDOptions) SetHeaders(param map[string]string) *DeleteServiceIDOptions { options.Headers = param return options } @@ -1570,7 +1585,7 @@ type EnityHistoryRecord struct { IamID *string `json:"iam_id" validate:"required"` // Account of the identity which triggered the action. - IamIdAccount *string `json:"iam_id_account" validate:"required"` + IamIDAccount *string `json:"iam_id_account" validate:"required"` // Action of the history entry. Action *string `json:"action" validate:"required"` @@ -1594,7 +1609,7 @@ func UnmarshalEnityHistoryRecord(m map[string]json.RawMessage, result interface{ if err != nil { return } - err = core.UnmarshalPrimitive(m, "iam_id_account", &obj.IamIdAccount) + err = core.UnmarshalPrimitive(m, "iam_id_account", &obj.IamIDAccount) if err != nil { return } @@ -1614,8 +1629,8 @@ func UnmarshalEnityHistoryRecord(m map[string]json.RawMessage, result interface{ return } -// GetApiKeyOptions : The GetApiKey options. -type GetApiKeyOptions struct { +// GetAPIKeyOptions : The GetAPIKey options. +type GetAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` @@ -1626,35 +1641,35 @@ type GetApiKeyOptions struct { Headers map[string]string } -// NewGetApiKeyOptions : Instantiate GetApiKeyOptions -func (*IamIdentityV1) NewGetApiKeyOptions(id string) *GetApiKeyOptions { - return &GetApiKeyOptions{ +// NewGetAPIKeyOptions : Instantiate GetAPIKeyOptions +func (*IamIdentityV1) NewGetAPIKeyOptions(id string) *GetAPIKeyOptions { + return &GetAPIKeyOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *GetApiKeyOptions) SetID(id string) *GetApiKeyOptions { +func (options *GetAPIKeyOptions) SetID(id string) *GetAPIKeyOptions { options.ID = core.StringPtr(id) return options } // SetIncludeHistory : Allow user to set IncludeHistory -func (options *GetApiKeyOptions) SetIncludeHistory(includeHistory bool) *GetApiKeyOptions { +func (options *GetAPIKeyOptions) SetIncludeHistory(includeHistory bool) *GetAPIKeyOptions { options.IncludeHistory = core.BoolPtr(includeHistory) return options } // SetHeaders : Allow user to set Headers -func (options *GetApiKeyOptions) SetHeaders(param map[string]string) *GetApiKeyOptions { +func (options *GetAPIKeyOptions) SetHeaders(param map[string]string) *GetAPIKeyOptions { options.Headers = param return options } -// GetApiKeysDetailsOptions : The GetApiKeysDetails options. -type GetApiKeysDetailsOptions struct { +// GetAPIKeysDetailsOptions : The GetAPIKeysDetails options. +type GetAPIKeysDetailsOptions struct { // API key value. - IAMApiKey *string `json:"IAM-ApiKey,omitempty"` + IamAPIKey *string `json:"IAM-ApiKey,omitempty"` // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` @@ -1663,31 +1678,31 @@ type GetApiKeysDetailsOptions struct { Headers map[string]string } -// NewGetApiKeysDetailsOptions : Instantiate GetApiKeysDetailsOptions -func (*IamIdentityV1) NewGetApiKeysDetailsOptions() *GetApiKeysDetailsOptions { - return &GetApiKeysDetailsOptions{} +// NewGetAPIKeysDetailsOptions : Instantiate GetAPIKeysDetailsOptions +func (*IamIdentityV1) NewGetAPIKeysDetailsOptions() *GetAPIKeysDetailsOptions { + return &GetAPIKeysDetailsOptions{} } -// SetIAMApiKey : Allow user to set IAMApiKey -func (options *GetApiKeysDetailsOptions) SetIAMApiKey(iAMApiKey string) *GetApiKeysDetailsOptions { - options.IAMApiKey = core.StringPtr(iAMApiKey) +// SetIamAPIKey : Allow user to set IamAPIKey +func (options *GetAPIKeysDetailsOptions) SetIamAPIKey(iamAPIKey string) *GetAPIKeysDetailsOptions { + options.IamAPIKey = core.StringPtr(iamAPIKey) return options } // SetIncludeHistory : Allow user to set IncludeHistory -func (options *GetApiKeysDetailsOptions) SetIncludeHistory(includeHistory bool) *GetApiKeysDetailsOptions { +func (options *GetAPIKeysDetailsOptions) SetIncludeHistory(includeHistory bool) *GetAPIKeysDetailsOptions { options.IncludeHistory = core.BoolPtr(includeHistory) return options } // SetHeaders : Allow user to set Headers -func (options *GetApiKeysDetailsOptions) SetHeaders(param map[string]string) *GetApiKeysDetailsOptions { +func (options *GetAPIKeysDetailsOptions) SetHeaders(param map[string]string) *GetAPIKeysDetailsOptions { options.Headers = param return options } -// GetServiceIdOptions : The GetServiceID options. -type GetServiceIdOptions struct { +// GetServiceIDOptions : The GetServiceID options. +type GetServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` @@ -1698,33 +1713,33 @@ type GetServiceIdOptions struct { Headers map[string]string } -// NewGetServiceIdOptions : Instantiate GetServiceIdOptions -func (*IamIdentityV1) NewGetServiceIdOptions(id string) *GetServiceIdOptions { - return &GetServiceIdOptions{ +// NewGetServiceIDOptions : Instantiate GetServiceIDOptions +func (*IamIdentityV1) NewGetServiceIDOptions(id string) *GetServiceIDOptions { + return &GetServiceIDOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *GetServiceIdOptions) SetID(id string) *GetServiceIdOptions { +func (options *GetServiceIDOptions) SetID(id string) *GetServiceIDOptions { options.ID = core.StringPtr(id) return options } // SetIncludeHistory : Allow user to set IncludeHistory -func (options *GetServiceIdOptions) SetIncludeHistory(includeHistory bool) *GetServiceIdOptions { +func (options *GetServiceIDOptions) SetIncludeHistory(includeHistory bool) *GetServiceIDOptions { options.IncludeHistory = core.BoolPtr(includeHistory) return options } // SetHeaders : Allow user to set Headers -func (options *GetServiceIdOptions) SetHeaders(param map[string]string) *GetServiceIdOptions { +func (options *GetServiceIDOptions) SetHeaders(param map[string]string) *GetServiceIDOptions { options.Headers = param return options } -// ListApiKeysOptions : The ListApiKeys options. -type ListApiKeysOptions struct { +// ListAPIKeysOptions : The ListAPIKeys options. +type ListAPIKeysOptions struct { // Account ID of the API keys(s) to query. If a service IAM ID is specified in iam_id then account_id must match the // account of the IAM ID. If a user IAM ID is specified in iam_id then then account_id must match the account of the // Authorization token. @@ -1760,88 +1775,88 @@ type ListApiKeysOptions struct { Headers map[string]string } -// Constants associated with the ListApiKeysOptions.Scope property. +// Constants associated with the ListAPIKeysOptions.Scope property. // Optional parameter to define the scope of the queried API Keys. Can be 'entity' (default) or 'account'. const ( - ListApiKeysOptions_Scope_Account = "account" - ListApiKeysOptions_Scope_Entity = "entity" + ListAPIKeysOptionsScopeAccountConst = "account" + ListAPIKeysOptionsScopeEntityConst = "entity" ) -// Constants associated with the ListApiKeysOptions.Type property. +// Constants associated with the ListAPIKeysOptions.Type property. // Optional parameter to filter the type of the queried API Keys. Can be 'user' or 'serviceid'. const ( - ListApiKeysOptions_Type_Serviceid = "serviceid" - ListApiKeysOptions_Type_User = "user" + ListAPIKeysOptionsTypeServiceidConst = "serviceid" + ListAPIKeysOptionsTypeUserConst = "user" ) -// Constants associated with the ListApiKeysOptions.Order property. +// Constants associated with the ListAPIKeysOptions.Order property. // Optional sort order, valid values are asc and desc. Default: asc. const ( - ListApiKeysOptions_Order_Asc = "asc" - ListApiKeysOptions_Order_Desc = "desc" + ListAPIKeysOptionsOrderAscConst = "asc" + ListAPIKeysOptionsOrderDescConst = "desc" ) -// NewListApiKeysOptions : Instantiate ListApiKeysOptions -func (*IamIdentityV1) NewListApiKeysOptions() *ListApiKeysOptions { - return &ListApiKeysOptions{} +// NewListAPIKeysOptions : Instantiate ListAPIKeysOptions +func (*IamIdentityV1) NewListAPIKeysOptions() *ListAPIKeysOptions { + return &ListAPIKeysOptions{} } // SetAccountID : Allow user to set AccountID -func (options *ListApiKeysOptions) SetAccountID(accountID string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetAccountID(accountID string) *ListAPIKeysOptions { options.AccountID = core.StringPtr(accountID) return options } // SetIamID : Allow user to set IamID -func (options *ListApiKeysOptions) SetIamID(iamID string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetIamID(iamID string) *ListAPIKeysOptions { options.IamID = core.StringPtr(iamID) return options } // SetPagesize : Allow user to set Pagesize -func (options *ListApiKeysOptions) SetPagesize(pagesize int64) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetPagesize(pagesize int64) *ListAPIKeysOptions { options.Pagesize = core.Int64Ptr(pagesize) return options } // SetPagetoken : Allow user to set Pagetoken -func (options *ListApiKeysOptions) SetPagetoken(pagetoken string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetPagetoken(pagetoken string) *ListAPIKeysOptions { options.Pagetoken = core.StringPtr(pagetoken) return options } // SetScope : Allow user to set Scope -func (options *ListApiKeysOptions) SetScope(scope string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetScope(scope string) *ListAPIKeysOptions { options.Scope = core.StringPtr(scope) return options } // SetType : Allow user to set Type -func (options *ListApiKeysOptions) SetType(typeVar string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetType(typeVar string) *ListAPIKeysOptions { options.Type = core.StringPtr(typeVar) return options } // SetSort : Allow user to set Sort -func (options *ListApiKeysOptions) SetSort(sort string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetSort(sort string) *ListAPIKeysOptions { options.Sort = core.StringPtr(sort) return options } // SetOrder : Allow user to set Order -func (options *ListApiKeysOptions) SetOrder(order string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetOrder(order string) *ListAPIKeysOptions { options.Order = core.StringPtr(order) return options } // SetIncludeHistory : Allow user to set IncludeHistory -func (options *ListApiKeysOptions) SetIncludeHistory(includeHistory bool) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetIncludeHistory(includeHistory bool) *ListAPIKeysOptions { options.IncludeHistory = core.BoolPtr(includeHistory) return options } // SetHeaders : Allow user to set Headers -func (options *ListApiKeysOptions) SetHeaders(param map[string]string) *ListApiKeysOptions { +func (options *ListAPIKeysOptions) SetHeaders(param map[string]string) *ListAPIKeysOptions { options.Headers = param return options } @@ -1877,8 +1892,8 @@ type ListServiceIdsOptions struct { // Constants associated with the ListServiceIdsOptions.Order property. // Optional sort order, valid values are asc and desc. Default: asc. const ( - ListServiceIdsOptions_Order_Asc = "asc" - ListServiceIdsOptions_Order_Desc = "desc" + ListServiceIdsOptionsOrderAscConst = "asc" + ListServiceIdsOptionsOrderDescConst = "desc" ) // NewListServiceIdsOptions : Instantiate ListServiceIdsOptions @@ -1934,8 +1949,8 @@ func (options *ListServiceIdsOptions) SetHeaders(param map[string]string) *ListS return options } -// LockApiKeyOptions : The LockApiKey options. -type LockApiKeyOptions struct { +// LockAPIKeyOptions : The LockAPIKey options. +type LockAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` @@ -1943,27 +1958,27 @@ type LockApiKeyOptions struct { Headers map[string]string } -// NewLockApiKeyOptions : Instantiate LockApiKeyOptions -func (*IamIdentityV1) NewLockApiKeyOptions(id string) *LockApiKeyOptions { - return &LockApiKeyOptions{ +// NewLockAPIKeyOptions : Instantiate LockAPIKeyOptions +func (*IamIdentityV1) NewLockAPIKeyOptions(id string) *LockAPIKeyOptions { + return &LockAPIKeyOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *LockApiKeyOptions) SetID(id string) *LockApiKeyOptions { +func (options *LockAPIKeyOptions) SetID(id string) *LockAPIKeyOptions { options.ID = core.StringPtr(id) return options } // SetHeaders : Allow user to set Headers -func (options *LockApiKeyOptions) SetHeaders(param map[string]string) *LockApiKeyOptions { +func (options *LockAPIKeyOptions) SetHeaders(param map[string]string) *LockAPIKeyOptions { options.Headers = param return options } -// LockServiceIdOptions : The LockServiceID options. -type LockServiceIdOptions struct { +// LockServiceIDOptions : The LockServiceID options. +type LockServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` @@ -1971,21 +1986,21 @@ type LockServiceIdOptions struct { Headers map[string]string } -// NewLockServiceIdOptions : Instantiate LockServiceIdOptions -func (*IamIdentityV1) NewLockServiceIdOptions(id string) *LockServiceIdOptions { - return &LockServiceIdOptions{ +// NewLockServiceIDOptions : Instantiate LockServiceIDOptions +func (*IamIdentityV1) NewLockServiceIDOptions(id string) *LockServiceIDOptions { + return &LockServiceIDOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *LockServiceIdOptions) SetID(id string) *LockServiceIdOptions { +func (options *LockServiceIDOptions) SetID(id string) *LockServiceIDOptions { options.ID = core.StringPtr(id) return options } // SetHeaders : Allow user to set Headers -func (options *LockServiceIdOptions) SetHeaders(param map[string]string) *LockServiceIdOptions { +func (options *LockServiceIDOptions) SetHeaders(param map[string]string) *LockServiceIDOptions { options.Headers = param return options } @@ -2095,7 +2110,7 @@ type ServiceID struct { // Cloud Resource Name of the item. Example Cloud Resource Name: // 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::serviceid:1234-5678-9012'. - Crn *string `json:"crn" validate:"required"` + CRN *string `json:"crn" validate:"required"` // The service ID cannot be changed if set to true. Locked *bool `json:"locked" validate:"required"` @@ -2124,7 +2139,7 @@ type ServiceID struct { History []EnityHistoryRecord `json:"history,omitempty"` // Response body format for API key V1 REST requests. - Apikey *ApiKey `json:"apikey" validate:"required"` + Apikey *APIKey `json:"apikey" validate:"required"` } @@ -2147,7 +2162,7 @@ func UnmarshalServiceID(m map[string]json.RawMessage, result interface{}) (err e if err != nil { return } - err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { return } @@ -2183,7 +2198,7 @@ func UnmarshalServiceID(m map[string]json.RawMessage, result interface{}) (err e if err != nil { return } - err = core.UnmarshalModel(m, "apikey", &obj.Apikey, UnmarshalApiKey) + err = core.UnmarshalModel(m, "apikey", &obj.Apikey, UnmarshalAPIKey) if err != nil { return } @@ -2191,8 +2206,8 @@ func UnmarshalServiceID(m map[string]json.RawMessage, result interface{}) (err e return } -// ServiceIdList : Response body format for the list service ID V1 REST request. -type ServiceIdList struct { +// ServiceIDList : Response body format for the list service ID V1 REST request. +type ServiceIDList struct { // Context with key properties for problem determination. Context *ResponseContext `json:"context,omitempty"` @@ -2218,9 +2233,9 @@ type ServiceIdList struct { } -// UnmarshalServiceIdList unmarshals an instance of ServiceIdList from the specified map of raw messages. -func UnmarshalServiceIdList(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ServiceIdList) +// UnmarshalServiceIDList unmarshals an instance of ServiceIDList from the specified map of raw messages. +func UnmarshalServiceIDList(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ServiceIDList) err = core.UnmarshalModel(m, "context", &obj.Context, UnmarshalResponseContext) if err != nil { return @@ -2253,8 +2268,8 @@ func UnmarshalServiceIdList(m map[string]json.RawMessage, result interface{}) (e return } -// UnlockApiKeyOptions : The UnlockApiKey options. -type UnlockApiKeyOptions struct { +// UnlockAPIKeyOptions : The UnlockAPIKey options. +type UnlockAPIKeyOptions struct { // Unique ID of the API key. ID *string `json:"id" validate:"required,ne="` @@ -2262,27 +2277,27 @@ type UnlockApiKeyOptions struct { Headers map[string]string } -// NewUnlockApiKeyOptions : Instantiate UnlockApiKeyOptions -func (*IamIdentityV1) NewUnlockApiKeyOptions(id string) *UnlockApiKeyOptions { - return &UnlockApiKeyOptions{ +// NewUnlockAPIKeyOptions : Instantiate UnlockAPIKeyOptions +func (*IamIdentityV1) NewUnlockAPIKeyOptions(id string) *UnlockAPIKeyOptions { + return &UnlockAPIKeyOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *UnlockApiKeyOptions) SetID(id string) *UnlockApiKeyOptions { +func (options *UnlockAPIKeyOptions) SetID(id string) *UnlockAPIKeyOptions { options.ID = core.StringPtr(id) return options } // SetHeaders : Allow user to set Headers -func (options *UnlockApiKeyOptions) SetHeaders(param map[string]string) *UnlockApiKeyOptions { +func (options *UnlockAPIKeyOptions) SetHeaders(param map[string]string) *UnlockAPIKeyOptions { options.Headers = param return options } -// UnlockServiceIdOptions : The UnlockServiceID options. -type UnlockServiceIdOptions struct { +// UnlockServiceIDOptions : The UnlockServiceID options. +type UnlockServiceIDOptions struct { // Unique ID of the service ID. ID *string `json:"id" validate:"required,ne="` @@ -2290,27 +2305,27 @@ type UnlockServiceIdOptions struct { Headers map[string]string } -// NewUnlockServiceIdOptions : Instantiate UnlockServiceIdOptions -func (*IamIdentityV1) NewUnlockServiceIdOptions(id string) *UnlockServiceIdOptions { - return &UnlockServiceIdOptions{ +// NewUnlockServiceIDOptions : Instantiate UnlockServiceIDOptions +func (*IamIdentityV1) NewUnlockServiceIDOptions(id string) *UnlockServiceIDOptions { + return &UnlockServiceIDOptions{ ID: core.StringPtr(id), } } // SetID : Allow user to set ID -func (options *UnlockServiceIdOptions) SetID(id string) *UnlockServiceIdOptions { +func (options *UnlockServiceIDOptions) SetID(id string) *UnlockServiceIDOptions { options.ID = core.StringPtr(id) return options } // SetHeaders : Allow user to set Headers -func (options *UnlockServiceIdOptions) SetHeaders(param map[string]string) *UnlockServiceIdOptions { +func (options *UnlockServiceIDOptions) SetHeaders(param map[string]string) *UnlockServiceIDOptions { options.Headers = param return options } -// UpdateApiKeyOptions : The UpdateApiKey options. -type UpdateApiKeyOptions struct { +// UpdateAPIKeyOptions : The UpdateAPIKey options. +type UpdateAPIKeyOptions struct { // Unique ID of the API key to be updated. ID *string `json:"id" validate:"required,ne="` @@ -2331,46 +2346,46 @@ type UpdateApiKeyOptions struct { Headers map[string]string } -// NewUpdateApiKeyOptions : Instantiate UpdateApiKeyOptions -func (*IamIdentityV1) NewUpdateApiKeyOptions(id string, ifMatch string) *UpdateApiKeyOptions { - return &UpdateApiKeyOptions{ +// NewUpdateAPIKeyOptions : Instantiate UpdateAPIKeyOptions +func (*IamIdentityV1) NewUpdateAPIKeyOptions(id string, ifMatch string) *UpdateAPIKeyOptions { + return &UpdateAPIKeyOptions{ ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), } } // SetID : Allow user to set ID -func (options *UpdateApiKeyOptions) SetID(id string) *UpdateApiKeyOptions { +func (options *UpdateAPIKeyOptions) SetID(id string) *UpdateAPIKeyOptions { options.ID = core.StringPtr(id) return options } // SetIfMatch : Allow user to set IfMatch -func (options *UpdateApiKeyOptions) SetIfMatch(ifMatch string) *UpdateApiKeyOptions { +func (options *UpdateAPIKeyOptions) SetIfMatch(ifMatch string) *UpdateAPIKeyOptions { options.IfMatch = core.StringPtr(ifMatch) return options } // SetName : Allow user to set Name -func (options *UpdateApiKeyOptions) SetName(name string) *UpdateApiKeyOptions { +func (options *UpdateAPIKeyOptions) SetName(name string) *UpdateAPIKeyOptions { options.Name = core.StringPtr(name) return options } // SetDescription : Allow user to set Description -func (options *UpdateApiKeyOptions) SetDescription(description string) *UpdateApiKeyOptions { +func (options *UpdateAPIKeyOptions) SetDescription(description string) *UpdateAPIKeyOptions { options.Description = core.StringPtr(description) return options } // SetHeaders : Allow user to set Headers -func (options *UpdateApiKeyOptions) SetHeaders(param map[string]string) *UpdateApiKeyOptions { +func (options *UpdateAPIKeyOptions) SetHeaders(param map[string]string) *UpdateAPIKeyOptions { options.Headers = param return options } -// UpdateServiceIdOptions : The UpdateServiceID options. -type UpdateServiceIdOptions struct { +// UpdateServiceIDOptions : The UpdateServiceID options. +type UpdateServiceIDOptions struct { // Unique ID of the service ID to be updated. ID *string `json:"id" validate:"required,ne="` @@ -2395,46 +2410,46 @@ type UpdateServiceIdOptions struct { Headers map[string]string } -// NewUpdateServiceIdOptions : Instantiate UpdateServiceIdOptions -func (*IamIdentityV1) NewUpdateServiceIdOptions(id string, ifMatch string) *UpdateServiceIdOptions { - return &UpdateServiceIdOptions{ +// NewUpdateServiceIDOptions : Instantiate UpdateServiceIDOptions +func (*IamIdentityV1) NewUpdateServiceIDOptions(id string, ifMatch string) *UpdateServiceIDOptions { + return &UpdateServiceIDOptions{ ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), } } // SetID : Allow user to set ID -func (options *UpdateServiceIdOptions) SetID(id string) *UpdateServiceIdOptions { +func (options *UpdateServiceIDOptions) SetID(id string) *UpdateServiceIDOptions { options.ID = core.StringPtr(id) return options } // SetIfMatch : Allow user to set IfMatch -func (options *UpdateServiceIdOptions) SetIfMatch(ifMatch string) *UpdateServiceIdOptions { +func (options *UpdateServiceIDOptions) SetIfMatch(ifMatch string) *UpdateServiceIDOptions { options.IfMatch = core.StringPtr(ifMatch) return options } // SetName : Allow user to set Name -func (options *UpdateServiceIdOptions) SetName(name string) *UpdateServiceIdOptions { +func (options *UpdateServiceIDOptions) SetName(name string) *UpdateServiceIDOptions { options.Name = core.StringPtr(name) return options } // SetDescription : Allow user to set Description -func (options *UpdateServiceIdOptions) SetDescription(description string) *UpdateServiceIdOptions { +func (options *UpdateServiceIDOptions) SetDescription(description string) *UpdateServiceIDOptions { options.Description = core.StringPtr(description) return options } // SetUniqueInstanceCrns : Allow user to set UniqueInstanceCrns -func (options *UpdateServiceIdOptions) SetUniqueInstanceCrns(uniqueInstanceCrns []string) *UpdateServiceIdOptions { +func (options *UpdateServiceIDOptions) SetUniqueInstanceCrns(uniqueInstanceCrns []string) *UpdateServiceIDOptions { options.UniqueInstanceCrns = uniqueInstanceCrns return options } // SetHeaders : Allow user to set Headers -func (options *UpdateServiceIdOptions) SetHeaders(param map[string]string) *UpdateServiceIdOptions { +func (options *UpdateServiceIDOptions) SetHeaders(param map[string]string) *UpdateServiceIDOptions { options.Headers = param return options } diff --git a/iamidentityv1/iam_identity_v1_examples_test.go b/iamidentityv1/iam_identity_v1_examples_test.go index 3c48fc0f..18342b85 100644 --- a/iamidentityv1/iam_identity_v1_examples_test.go +++ b/iamidentityv1/iam_identity_v1_examples_test.go @@ -60,7 +60,7 @@ var ( serviceIDName string = "Example-ServiceId" accountID string iamID string - iamApiKey string + iamAPIKey string apikeyID string apikeyEtag string @@ -103,8 +103,8 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { iamID = config["IAM_ID"] Expect(iamID).ToNot(BeEmpty()) - iamApiKey = config["APIKEY"] - Expect(iamApiKey).ToNot(BeEmpty()) + iamAPIKey = config["APIKEY"] + Expect(iamAPIKey).ToNot(BeEmpty()) fmt.Printf("Service URL: %s\n", serviceURL) }) @@ -139,13 +139,13 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`CreateApiKey request example`, func() { + It(`CreateAPIKey request example`, func() { // begin-create_api_key - createApiKeyOptions := iamIdentityService.NewCreateApiKeyOptions(apikeyName, iamID) - createApiKeyOptions.SetDescription("Example ApiKey") + createAPIKeyOptions := iamIdentityService.NewCreateAPIKeyOptions(apikeyName, iamID) + createAPIKeyOptions.SetDescription("Example ApiKey") - apiKey, response, err := iamIdentityService.CreateApiKey(createApiKeyOptions) + apiKey, response, err := iamIdentityService.CreateAPIKey(createAPIKeyOptions) if err != nil { panic(err) } @@ -160,15 +160,15 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(apiKey).ToNot(BeNil()) Expect(apikeyID).ToNot(BeNil()) }) - It(`ListApiKeys request example`, func() { + It(`ListAPIKeys request example`, func() { // begin-list_api_keys - listApiKeysOptions := iamIdentityService.NewListApiKeysOptions() - listApiKeysOptions.SetAccountID(accountID) - listApiKeysOptions.SetIamID(iamID) - listApiKeysOptions.SetIncludeHistory(true) + listAPIKeysOptions := iamIdentityService.NewListAPIKeysOptions() + listAPIKeysOptions.SetAccountID(accountID) + listAPIKeysOptions.SetIamID(iamID) + listAPIKeysOptions.SetIncludeHistory(true) - apiKeyList, response, err := iamIdentityService.ListApiKeys(listApiKeysOptions) + apiKeyList, response, err := iamIdentityService.ListAPIKeys(listAPIKeysOptions) if err != nil { panic(err) } @@ -181,14 +181,14 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) Expect(apiKeyList).ToNot(BeNil()) }) - It(`GetApiKeysDetails request example`, func() { + It(`GetAPIKeysDetails request example`, func() { // begin-get_api_keys_details - getApiKeysDetailsOptions := iamIdentityService.NewGetApiKeysDetailsOptions() - getApiKeysDetailsOptions.SetIAMApiKey(iamApiKey) - getApiKeysDetailsOptions.SetIncludeHistory(false) + getAPIKeysDetailsOptions := iamIdentityService.NewGetAPIKeysDetailsOptions() + getAPIKeysDetailsOptions.SetIamAPIKey(iamAPIKey) + getAPIKeysDetailsOptions.SetIncludeHistory(false) - apiKey, response, err := iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptions) + apiKey, response, err := iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptions) if err != nil { panic(err) } @@ -201,12 +201,12 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) Expect(apiKey).ToNot(BeNil()) }) - It(`GetApiKey request example`, func() { + It(`GetAPIKey request example`, func() { // begin-get_api_key - getApiKeyOptions := iamIdentityService.NewGetApiKeyOptions(apikeyID) + getAPIKeyOptions := iamIdentityService.NewGetAPIKeyOptions(apikeyID) - apiKey, response, err := iamIdentityService.GetApiKey(getApiKeyOptions) + apiKey, response, err := iamIdentityService.GetAPIKey(getAPIKeyOptions) if err != nil { panic(err) } @@ -221,13 +221,13 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(apiKey).ToNot(BeNil()) Expect(apikeyEtag).ToNot(BeEmpty()) }) - It(`UpdateApiKey request example`, func() { + It(`UpdateAPIKey request example`, func() { // begin-update_api_key - updateApiKeyOptions := iamIdentityService.NewUpdateApiKeyOptions(apikeyID, apikeyEtag) - updateApiKeyOptions.SetDescription("This is an updated description") + updateAPIKeyOptions := iamIdentityService.NewUpdateAPIKeyOptions(apikeyID, apikeyEtag) + updateAPIKeyOptions.SetDescription("This is an updated description") - apiKey, response, err := iamIdentityService.UpdateApiKey(updateApiKeyOptions) + apiKey, response, err := iamIdentityService.UpdateAPIKey(updateAPIKeyOptions) if err != nil { panic(err) } @@ -240,12 +240,12 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) Expect(apiKey).ToNot(BeNil()) }) - It(`LockApiKey request example`, func() { + It(`LockAPIKey request example`, func() { // begin-lock_api_key - lockApiKeyOptions := iamIdentityService.NewLockApiKeyOptions(apikeyID) + lockAPIKeyOptions := iamIdentityService.NewLockAPIKeyOptions(apikeyID) - response, err := iamIdentityService.LockApiKey(lockApiKeyOptions) + response, err := iamIdentityService.LockAPIKey(lockAPIKeyOptions) if err != nil { panic(err) } @@ -255,12 +255,12 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) }) - It(`UnlockApiKey request example`, func() { + It(`UnlockAPIKey request example`, func() { // begin-unlock_api_key - unlockApiKeyOptions := iamIdentityService.NewUnlockApiKeyOptions(apikeyID) + unlockAPIKeyOptions := iamIdentityService.NewUnlockAPIKeyOptions(apikeyID) - response, err := iamIdentityService.UnlockApiKey(unlockApiKeyOptions) + response, err := iamIdentityService.UnlockAPIKey(unlockAPIKeyOptions) if err != nil { panic(err) } @@ -270,12 +270,12 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) }) - It(`DeleteApiKey request example`, func() { + It(`DeleteAPIKey request example`, func() { // begin-delete_api_key - deleteApiKeyOptions := iamIdentityService.NewDeleteApiKeyOptions(apikeyID) + deleteAPIKeyOptions := iamIdentityService.NewDeleteAPIKeyOptions(apikeyID) - response, err := iamIdentityService.DeleteApiKey(deleteApiKeyOptions) + response, err := iamIdentityService.DeleteAPIKey(deleteAPIKeyOptions) if err != nil { panic(err) } @@ -288,10 +288,10 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { It(`CreateServiceID request example`, func() { // begin-create_service_id - createServiceIdOptions := iamIdentityService.NewCreateServiceIdOptions(accountID, serviceIDName) - createServiceIdOptions.SetDescription("Example ServiceId") + createServiceIDOptions := iamIdentityService.NewCreateServiceIDOptions(accountID, serviceIDName) + createServiceIDOptions.SetDescription("Example ServiceId") - serviceID, response, err := iamIdentityService.CreateServiceID(createServiceIdOptions) + serviceID, response, err := iamIdentityService.CreateServiceID(createServiceIDOptions) if err != nil { panic(err) } @@ -309,9 +309,9 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { It(`GetServiceID request example`, func() { // begin-get_service_id - getServiceIdOptions := iamIdentityService.NewGetServiceIdOptions(svcID) + getServiceIDOptions := iamIdentityService.NewGetServiceIDOptions(svcID) - serviceID, response, err := iamIdentityService.GetServiceID(getServiceIdOptions) + serviceID, response, err := iamIdentityService.GetServiceID(getServiceIDOptions) if err != nil { panic(err) } @@ -333,26 +333,26 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { listServiceIdsOptions.SetAccountID(accountID) listServiceIdsOptions.SetName(serviceIDName) - serviceIdList, response, err := iamIdentityService.ListServiceIds(listServiceIdsOptions) + serviceIDList, response, err := iamIdentityService.ListServiceIds(listServiceIdsOptions) if err != nil { panic(err) } - b, _ := json.MarshalIndent(serviceIdList, "", " ") + b, _ := json.MarshalIndent(serviceIDList, "", " ") fmt.Println(string(b)) // end-list_service_ids Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) - Expect(serviceIdList).ToNot(BeNil()) + Expect(serviceIDList).ToNot(BeNil()) }) It(`UpdateServiceID request example`, func() { // begin-update_service_id - updateServiceIdOptions := iamIdentityService.NewUpdateServiceIdOptions(svcID, svcIDEtag) - updateServiceIdOptions.SetDescription("This is an updated description") + updateServiceIDOptions := iamIdentityService.NewUpdateServiceIDOptions(svcID, svcIDEtag) + updateServiceIDOptions.SetDescription("This is an updated description") - serviceID, response, err := iamIdentityService.UpdateServiceID(updateServiceIdOptions) + serviceID, response, err := iamIdentityService.UpdateServiceID(updateServiceIDOptions) if err != nil { panic(err) } @@ -368,9 +368,9 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { It(`LockServiceID request example`, func() { // begin-lock_service_id - lockServiceIdOptions := iamIdentityService.NewLockServiceIdOptions(svcID) + lockServiceIDOptions := iamIdentityService.NewLockServiceIDOptions(svcID) - response, err := iamIdentityService.LockServiceID(lockServiceIdOptions) + response, err := iamIdentityService.LockServiceID(lockServiceIDOptions) if err != nil { panic(err) } @@ -383,9 +383,9 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { It(`UnlockServiceID request example`, func() { // begin-unlock_service_id - unlockServiceIdOptions := iamIdentityService.NewUnlockServiceIdOptions(svcID) + unlockServiceIDOptions := iamIdentityService.NewUnlockServiceIDOptions(svcID) - response, err := iamIdentityService.UnlockServiceID(unlockServiceIdOptions) + response, err := iamIdentityService.UnlockServiceID(unlockServiceIDOptions) if err != nil { panic(err) } @@ -398,9 +398,9 @@ var _ = Describe(`IamIdentityV1 Examples Tests`, func() { It(`DeleteServiceID request example`, func() { // begin-delete_service_id - deleteServiceIdOptions := iamIdentityService.NewDeleteServiceIdOptions(svcID) + deleteServiceIDOptions := iamIdentityService.NewDeleteServiceIDOptions(svcID) - response, err := iamIdentityService.DeleteServiceID(deleteServiceIdOptions) + response, err := iamIdentityService.DeleteServiceID(deleteServiceIDOptions) if err != nil { panic(err) } diff --git a/iamidentityv1/iam_identity_v1_integration_test.go b/iamidentityv1/iam_identity_v1_integration_test.go index 624fcedd..2fa79751 100644 --- a/iamidentityv1/iam_identity_v1_integration_test.go +++ b/iamidentityv1/iam_identity_v1_integration_test.go @@ -45,7 +45,7 @@ var ( serviceIDName string = "Go-SDK-IT-ServiceId" accountID string iamID string - iamApiKey string + iamAPIKey string iamIdentityService *iamidentityv1.IamIdentityV1 ) @@ -95,8 +95,8 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { iamID = config["IAM_ID"] Expect(iamID).ToNot(BeEmpty()) - iamApiKey = config["APIKEY"] - Expect(iamApiKey).ToNot(BeEmpty()) + iamAPIKey = config["APIKEY"] + Expect(iamAPIKey).ToNot(BeEmpty()) fmt.Fprintf(GinkgoWriter, "Service URL: %s\n", serviceURL) shouldSkipTest = func() {} @@ -127,72 +127,72 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) }) - Describe(`CreateApiKey1 - Create API key #1`, func() { + Describe(`CreateAPIKey1 - Create API key #1`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`CreateApiKey(createApiKeyOptions *CreateApiKeyOptions)`, func() { + It(`CreateAPIKey(createAPIKeyOptions *CreateAPIKeyOptions)`, func() { - createApiKeyOptions := &iamidentityv1.CreateApiKeyOptions{ + createAPIKeyOptions := &iamidentityv1.CreateAPIKeyOptions{ Name: &apikeyName, IamID: &iamID, Description: core.StringPtr("GoSDK test apikey #1"), } - apiKey, response, err := iamIdentityService.CreateApiKey(createApiKeyOptions) + apiKey, response, err := iamIdentityService.CreateAPIKey(createAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(201)) Expect(apiKey).ToNot(BeNil()) - fmt.Fprintf(GinkgoWriter, "CreateApiKey #1 response:\n%s\n", common.ToJSON(apiKey)) + fmt.Fprintf(GinkgoWriter, "CreateAPIKey #1 response:\n%s\n", common.ToJSON(apiKey)) apikeyId1 = *apiKey.ID Expect(apikeyId1).ToNot(BeNil()) }) }) - Describe(`CreateApiKey2 - Create API key #2`, func() { + Describe(`CreateAPIKey2 - Create API key #2`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`CreateApiKey(createApiKeyOptions *CreateApiKeyOptions)`, func() { + It(`CreateAPIKey(createAPIKeyOptions *CreateAPIKeyOptions)`, func() { - createApiKeyOptions := &iamidentityv1.CreateApiKeyOptions{ + createAPIKeyOptions := &iamidentityv1.CreateAPIKeyOptions{ Name: &apikeyName, IamID: &iamID, Description: core.StringPtr("GoSDK test apikey #2"), } - apiKey, response, err := iamIdentityService.CreateApiKey(createApiKeyOptions) + apiKey, response, err := iamIdentityService.CreateAPIKey(createAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(201)) Expect(apiKey).ToNot(BeNil()) - fmt.Fprintf(GinkgoWriter, "CreateApiKey #2 response:\n%s\n", common.ToJSON(apiKey)) + fmt.Fprintf(GinkgoWriter, "CreateAPIKey #2 response:\n%s\n", common.ToJSON(apiKey)) apikeyId2 = *apiKey.ID Expect(apikeyId2).ToNot(BeNil()) }) }) - Describe(`GetApiKey - Get details of an API key`, func() { + Describe(`GetAPIKey - Get details of an API key`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`GetApiKey(getApiKeyOptions *GetApiKeyOptions)`, func() { + It(`GetAPIKey(getAPIKeyOptions *GetAPIKeyOptions)`, func() { Expect(apikeyId1).ToNot(BeNil()) - getApiKeyOptions := &iamidentityv1.GetApiKeyOptions{ + getAPIKeyOptions := &iamidentityv1.GetAPIKeyOptions{ ID: &apikeyId1, IncludeHistory: core.BoolPtr(true), } - apiKey, response, err := iamIdentityService.GetApiKey(getApiKeyOptions) + apiKey, response, err := iamIdentityService.GetAPIKey(getAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(apiKey).ToNot(BeNil()) - fmt.Fprintf(GinkgoWriter, "GetApiKey response:\n%s\n", common.ToJSON(apiKey)) + fmt.Fprintf(GinkgoWriter, "GetAPIKey response:\n%s\n", common.ToJSON(apiKey)) Expect(*apiKey.ID).To(Equal(apikeyId1)) Expect(*apiKey.Name).To(Equal(apikeyName)) @@ -201,7 +201,7 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { Expect(*apiKey.CreatedBy).To(Equal(iamID)) Expect(*apiKey.CreatedAt).ToNot(BeNil()) Expect(*apiKey.Locked).To(BeFalse()) - Expect(*apiKey.Crn).ToNot(BeNil()) + Expect(*apiKey.CRN).ToNot(BeNil()) Expect(apiKey.History).ToNot(BeEmpty()) // Grab the Etag value from the response for use in the update operation. @@ -210,23 +210,23 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) }) - Describe(`GetApiKeysDetails - Get details of an API key by its value`, func() { + Describe(`GetAPIKeysDetails - Get details of an API key by its value`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`GetApiKeysDetails(getApiKeysDetailsOptions *GetApiKeysDetailsOptions)`, func() { + It(`GetAPIKeysDetails(getAPIKeysDetailsOptions *GetAPIKeysDetailsOptions)`, func() { - getApiKeysDetailsOptions := &iamidentityv1.GetApiKeysDetailsOptions{ - IAMApiKey: &iamApiKey, + getAPIKeysDetailsOptions := &iamidentityv1.GetAPIKeysDetailsOptions{ + IamAPIKey: &iamAPIKey, IncludeHistory: core.BoolPtr(true), } - apiKey, response, err := iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptions) + apiKey, response, err := iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(apiKey).ToNot(BeNil()) - fmt.Fprintf(GinkgoWriter, "GetApiKeyDetails response:\n%s\n", common.ToJSON(apiKey)) + fmt.Fprintf(GinkgoWriter, "GetAPIKeyDetails response:\n%s\n", common.ToJSON(apiKey)) Expect(*apiKey.AccountID).To(Equal(accountID)) Expect(*apiKey.IamID).To(Equal(iamID)) @@ -235,13 +235,13 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) }) - Describe(`ListApiKeys - Get API keys for a given service or user IAM ID and account ID`, func() { + Describe(`ListAPIKeys - Get API keys for a given service or user IAM ID and account ID`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`ListApiKeys(listApiKeysOptions *ListApiKeysOptions)`, func() { + It(`ListAPIKeys(listAPIKeysOptions *ListAPIKeysOptions)`, func() { - apikeys := []iamidentityv1.ApiKey{} + apikeys := []iamidentityv1.APIKey{} // var pageToken *string = nil var pageTokenPresent bool = true @@ -249,18 +249,18 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { // for ok := true; ok; ok = (pageToken != nil) { for pageTokenPresent { - listApiKeysOptions := &iamidentityv1.ListApiKeysOptions{ + listAPIKeysOptions := &iamidentityv1.ListAPIKeysOptions{ AccountID: &accountID, IamID: &iamID, Pagetoken: pageToken, Pagesize: core.Int64Ptr(int64(1)), } - apiKeyList, response, err := iamIdentityService.ListApiKeys(listApiKeysOptions) + apiKeyList, response, err := iamIdentityService.ListAPIKeys(listAPIKeysOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(apiKeyList).ToNot(BeNil()) - fmt.Fprintf(GinkgoWriter, "ListApiKeys response:\n%s\n", common.ToJSON(apiKeyList)) + fmt.Fprintf(GinkgoWriter, "ListAPIKeys response:\n%s\n", common.ToJSON(apiKeyList)) // Walk through the returned results and save off the apikeys that we created earlier. for _, apikey := range apiKeyList.Apikeys { @@ -278,114 +278,114 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) }) - Describe(`UpdateApiKey - Updates an API key`, func() { + Describe(`UpdateAPIKey - Updates an API key`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`UpdateApiKey(updateApiKeyOptions *UpdateApiKeyOptions)`, func() { + It(`UpdateAPIKey(updateAPIKeyOptions *UpdateAPIKeyOptions)`, func() { Expect(apikeyId1).ToNot(BeEmpty()) Expect(apikeyEtag1).ToNot(BeEmpty()) - updateApiKeyOptions := &iamidentityv1.UpdateApiKeyOptions{ + updateAPIKeyOptions := &iamidentityv1.UpdateAPIKeyOptions{ ID: &apikeyId1, IfMatch: &apikeyEtag1, Description: &newDescription, } - apiKey, response, err := iamIdentityService.UpdateApiKey(updateApiKeyOptions) + apiKey, response, err := iamIdentityService.UpdateAPIKey(updateAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(apiKey).ToNot(BeNil()) - fmt.Fprintf(GinkgoWriter, "UpdateApiKey response:\n%s\n", common.ToJSON(apiKey)) + fmt.Fprintf(GinkgoWriter, "UpdateAPIKey response:\n%s\n", common.ToJSON(apiKey)) Expect(*apiKey.ID).To(Equal(apikeyId1)) Expect(*apiKey.Description).To(Equal(newDescription)) }) }) - Describe(`LockApiKey - Lock the API key`, func() { + Describe(`LockAPIKey - Lock the API key`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`LockApiKey(lockApiKeyOptions *LockApiKeyOptions)`, func() { + It(`LockAPIKey(lockAPIKeyOptions *LockAPIKeyOptions)`, func() { Expect(apikeyId2).ToNot(BeEmpty()) - lockApiKeyOptions := &iamidentityv1.LockApiKeyOptions{ + lockAPIKeyOptions := &iamidentityv1.LockAPIKeyOptions{ ID: &apikeyId2, } - response, err := iamIdentityService.LockApiKey(lockApiKeyOptions) + response, err := iamIdentityService.LockAPIKey(lockAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) - apiKey := getApikey(iamIdentityService, apikeyId2) + apiKey := getAPIkey(iamIdentityService, apikeyId2) Expect(apiKey).ToNot(BeNil()) Expect(*apiKey.Locked).To(BeTrue()) }) }) - Describe(`UnlockApiKey - Unlock the API key`, func() { + Describe(`UnlockAPIKey - Unlock the API key`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`UnlockApiKey(unlockApiKeyOptions *UnlockApiKeyOptions)`, func() { + It(`UnlockAPIKey(unlockAPIKeyOptions *UnlockAPIKeyOptions)`, func() { Expect(apikeyId2).ToNot(BeEmpty()) - unlockApiKeyOptions := &iamidentityv1.UnlockApiKeyOptions{ + unlockAPIKeyOptions := &iamidentityv1.UnlockAPIKeyOptions{ ID: &apikeyId2, } - response, err := iamIdentityService.UnlockApiKey(unlockApiKeyOptions) + response, err := iamIdentityService.UnlockAPIKey(unlockAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) - apiKey := getApikey(iamIdentityService, apikeyId2) + apiKey := getAPIkey(iamIdentityService, apikeyId2) Expect(apiKey).ToNot(BeNil()) Expect(*apiKey.Locked).To(BeFalse()) }) }) - Describe(`DeleteApiKey1 - Deletes an API key1`, func() { + Describe(`DeleteAPIKey1 - Deletes an API key1`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`DeleteApiKey(deleteApiKeyOptions *DeleteApiKeyOptions)`, func() { + It(`DeleteAPIKey(deleteAPIKeyOptions *DeleteAPIKeyOptions)`, func() { Expect(apikeyId1).ToNot(BeEmpty()) - deleteApiKeyOptions := &iamidentityv1.DeleteApiKeyOptions{ + deleteAPIKeyOptions := &iamidentityv1.DeleteAPIKeyOptions{ ID: &apikeyId1, } - response, err := iamIdentityService.DeleteApiKey(deleteApiKeyOptions) + response, err := iamIdentityService.DeleteAPIKey(deleteAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) - apiKey := getApikey(iamIdentityService, apikeyId1) + apiKey := getAPIkey(iamIdentityService, apikeyId1) Expect(apiKey).To(BeNil()) }) }) - Describe(`DeleteApiKey2 - Deletes an API key2`, func() { + Describe(`DeleteAPIKey2 - Deletes an API key2`, func() { BeforeEach(func() { shouldSkipTest() }) - It(`DeleteApiKey(deleteApiKeyOptions *DeleteApiKeyOptions)`, func() { + It(`DeleteAPIKey(deleteAPIKeyOptions *DeleteAPIKeyOptions)`, func() { Expect(apikeyId2).ToNot(BeEmpty()) - deleteApiKeyOptions := &iamidentityv1.DeleteApiKeyOptions{ + deleteAPIKeyOptions := &iamidentityv1.DeleteAPIKeyOptions{ ID: &apikeyId2, } - response, err := iamIdentityService.DeleteApiKey(deleteApiKeyOptions) + response, err := iamIdentityService.DeleteAPIKey(deleteAPIKeyOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) - apiKey := getApikey(iamIdentityService, apikeyId2) + apiKey := getAPIkey(iamIdentityService, apikeyId2) Expect(apiKey).To(BeNil()) }) }) @@ -396,13 +396,13 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) It(`CreateServiceID(createServiceIdOptions *CreateServiceIdOptions)`, func() { - createServiceIdOptions := &iamidentityv1.CreateServiceIdOptions{ + createServiceIDOptions := &iamidentityv1.CreateServiceIDOptions{ AccountID: &accountID, Name: &serviceIDName, Description: core.StringPtr("GoSDK test serviceId"), } - serviceID, response, err := iamIdentityService.CreateServiceID(createServiceIdOptions) + serviceID, response, err := iamIdentityService.CreateServiceID(createServiceIDOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(201)) @@ -420,12 +420,12 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { }) It(`GetServiceID(getServiceIdOptions *GetServiceIdOptions)`, func() { Expect(serviceId1).ToNot(BeEmpty()) - getServiceIdOptions := &iamidentityv1.GetServiceIdOptions{ + getServiceIDOptions := &iamidentityv1.GetServiceIDOptions{ ID: &serviceId1, IncludeHistory: core.BoolPtr(true), } - serviceID, response, err := iamIdentityService.GetServiceID(getServiceIdOptions) + serviceID, response, err := iamIdentityService.GetServiceID(getServiceIDOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) @@ -476,13 +476,13 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { Expect(serviceId1).ToNot(BeEmpty()) Expect(serviceIdEtag1).ToNot(BeEmpty()) - updateServiceIdOptions := &iamidentityv1.UpdateServiceIdOptions{ + updateServiceIDOptions := &iamidentityv1.UpdateServiceIDOptions{ ID: &serviceId1, IfMatch: &serviceIdEtag1, Description: &newDescription, } - serviceID, response, err := iamIdentityService.UpdateServiceID(updateServiceIdOptions) + serviceID, response, err := iamIdentityService.UpdateServiceID(updateServiceIDOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(serviceID).ToNot(BeNil()) @@ -499,11 +499,11 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { It(`LockServiceID(lockServiceIdOptions *LockServiceIdOptions)`, func() { Expect(serviceId1).ToNot(BeEmpty()) - lockServiceIdOptions := &iamidentityv1.LockServiceIdOptions{ + lockServiceIDOptions := &iamidentityv1.LockServiceIDOptions{ ID: &serviceId1, } - response, err := iamIdentityService.LockServiceID(lockServiceIdOptions) + response, err := iamIdentityService.LockServiceID(lockServiceIDOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) fmt.Fprintf(GinkgoWriter, "LockServiceID response:\n%v\n", response) @@ -521,11 +521,11 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { It(`UnlockServiceID(unlockServiceIdOptions *UnlockServiceIdOptions)`, func() { Expect(serviceId1).ToNot(BeEmpty()) - unlockServiceIdOptions := &iamidentityv1.UnlockServiceIdOptions{ + unlockServiceIDOptions := &iamidentityv1.UnlockServiceIDOptions{ ID: &serviceId1, } - response, err := iamIdentityService.UnlockServiceID(unlockServiceIdOptions) + response, err := iamIdentityService.UnlockServiceID(unlockServiceIDOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) @@ -544,11 +544,11 @@ var _ = Describe(`IamIdentityV1 Integration Tests`, func() { It(`DeleteServiceID(deleteServiceIdOptions *DeleteServiceIdOptions)`, func() { Expect(serviceId1).ToNot(BeEmpty()) - deleteServiceIdOptions := &iamidentityv1.DeleteServiceIdOptions{ + deleteServiceIDOptions := &iamidentityv1.DeleteServiceIDOptions{ ID: &serviceId1, } - response, err := iamIdentityService.DeleteServiceID(deleteServiceIdOptions) + response, err := iamIdentityService.DeleteServiceID(deleteServiceIDOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(204)) @@ -564,19 +564,19 @@ var _ = AfterSuite(func() { fmt.Println("Finished teardown.") }) -func getApikey(service *iamidentityv1.IamIdentityV1, apikeyId string) *iamidentityv1.ApiKey { - getApiKeyOptions := &iamidentityv1.GetApiKeyOptions{ - ID: &apikeyId, +func getAPIkey(service *iamidentityv1.IamIdentityV1, apikeyID string) *iamidentityv1.APIKey { + getAPIKeyOptions := &iamidentityv1.GetAPIKeyOptions{ + ID: &apikeyID, } - apiKey, _, _ := service.GetApiKey(getApiKeyOptions) + apiKey, _, _ := service.GetAPIKey(getAPIKeyOptions) return apiKey } func getServiceID(iamIdentityService *iamidentityv1.IamIdentityV1, serviceID string) *iamidentityv1.ServiceID { - getServiceIdOptions := &iamidentityv1.GetServiceIdOptions{ + getServiceIDOptions := &iamidentityv1.GetServiceIDOptions{ ID: &serviceID, } - result, _, _ := iamIdentityService.GetServiceID(getServiceIdOptions) + result, _, _ := iamIdentityService.GetServiceID(getServiceIDOptions) return result } @@ -616,27 +616,27 @@ func cleanupResources(service *iamidentityv1.IamIdentityV1) { panic("'service' cannot be nil!") } - listApiKeysOptions := &iamidentityv1.ListApiKeysOptions{ + listAPIKeysOptions := &iamidentityv1.ListAPIKeysOptions{ AccountID: &accountID, IamID: &iamID, Pagesize: core.Int64Ptr(int64(100)), } - apiKeyList, response, err := service.ListApiKeys(listApiKeysOptions) + apiKeyList, response, err := service.ListAPIKeys(listAPIKeysOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) - numApiKeys := len(apiKeyList.Apikeys) - fmt.Fprintf(GinkgoWriter, ">>> Cleanup found %d apikeys.\n", numApiKeys) + numAPIKeys := len(apiKeyList.Apikeys) + fmt.Fprintf(GinkgoWriter, ">>> Cleanup found %d apikeys.\n", numAPIKeys) - if numApiKeys > 0 { + if numAPIKeys > 0 { for _, element := range apiKeyList.Apikeys { if *element.Name == apikeyName { fmt.Fprintf(GinkgoWriter, ">>> Deleting apikey: %s\n", *element.ID) - deleteApiKeyOptions := &iamidentityv1.DeleteApiKeyOptions{ + deleteAPIKeyOptions := &iamidentityv1.DeleteAPIKeyOptions{ ID: element.ID, } - response, err := service.DeleteApiKey(deleteApiKeyOptions) + response, err := service.DeleteAPIKey(deleteAPIKeyOptions) Expect(response).ToNot(BeNil()) Expect(err).To(BeNil()) } @@ -649,18 +649,18 @@ func cleanupResources(service *iamidentityv1.IamIdentityV1) { Pagesize: core.Int64Ptr(int64(100)), } - serviceIdList, response, err := service.ListServiceIds(listServiceIdsOptions) + serviceIDList, response, err := service.ListServiceIds(listServiceIdsOptions) - numServiceIds := len(serviceIdList.Serviceids) + numServiceIds := len(serviceIDList.Serviceids) fmt.Fprintf(GinkgoWriter, ">>> Cleanup found %d serviceIDs.\n", numServiceIds) if numServiceIds > 0 { - for _, element := range serviceIdList.Serviceids { + for _, element := range serviceIDList.Serviceids { fmt.Fprintf(GinkgoWriter, ">>> Deleting serviceId: %s\n", *element.ID) - deleteServiceIdOptions := &iamidentityv1.DeleteServiceIdOptions{ + deleteServiceIDOptions := &iamidentityv1.DeleteServiceIDOptions{ ID: element.ID, } - response, err := service.DeleteServiceID(deleteServiceIdOptions) + response, err := service.DeleteServiceID(deleteServiceIDOptions) Expect(response).ToNot(BeNil()) Expect(err).To(BeNil()) } diff --git a/iamidentityv1/iam_identity_v1_test.go b/iamidentityv1/iam_identity_v1_test.go index 7745efe6..65dc1486 100644 --- a/iamidentityv1/iam_identity_v1_test.go +++ b/iamidentityv1/iam_identity_v1_test.go @@ -77,6 +77,12 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(iamIdentityService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) + + clone := iamIdentityService.Clone() + Expect(clone).ToNot(BeNil()) + Expect(clone.Service != iamIdentityService.Service).To(BeTrue()) + Expect(clone.GetServiceURL()).To(Equal(iamIdentityService.GetServiceURL())) + Expect(clone.Service.Options.Authenticator).To(Equal(iamIdentityService.Service.Options.Authenticator)) }) It(`Create service client using external config and set url from constructor successfully`, func() { SetTestEnvironment(testEnvironment) @@ -87,6 +93,12 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService.Service.GetServiceURL()).To(Equal("https://testService/api")) ClearTestEnvironment(testEnvironment) + + clone := iamIdentityService.Clone() + Expect(clone).ToNot(BeNil()) + Expect(clone.Service != iamIdentityService.Service).To(BeTrue()) + Expect(clone.GetServiceURL()).To(Equal(iamIdentityService.GetServiceURL())) + Expect(clone.Service.Options.Authenticator).To(Equal(iamIdentityService.Service.Options.Authenticator)) }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) @@ -98,6 +110,12 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService.Service.GetServiceURL()).To(Equal("https://testService/api")) ClearTestEnvironment(testEnvironment) + + clone := iamIdentityService.Clone() + Expect(clone).ToNot(BeNil()) + Expect(clone.Service != iamIdentityService.Service).To(BeTrue()) + Expect(clone.GetServiceURL()).To(Equal(iamIdentityService.GetServiceURL())) + Expect(clone.Service.Options.Authenticator).To(Equal(iamIdentityService.Service.Options.Authenticator)) }) }) Context(`Using external config, construct service client instances with error: Invalid Auth`, func() { @@ -135,15 +153,25 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`ListApiKeys(listApiKeysOptions *ListApiKeysOptions) - Operation response error`, func() { - listApiKeysPath := "/v1/apikeys" + Describe(`Regional endpoint tests`, func() { + It(`GetServiceURLForRegion(region string)`, func() { + var url string + var err error + url, err = iamidentityv1.GetServiceURLForRegion("INVALID_REGION") + Expect(url).To(BeEmpty()) + Expect(err).ToNot(BeNil()) + fmt.Fprintf(GinkgoWriter, "Expected error: %s\n", err.Error()) + }) + }) + Describe(`ListAPIKeys(listAPIKeysOptions *ListAPIKeysOptions) - Operation response error`, func() { + listAPIKeysPath := "/v1/apikeys" 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(listApiKeysPath)) + Expect(req.URL.EscapedPath()).To(Equal(listAPIKeysPath)) Expect(req.Method).To(Equal("GET")) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) @@ -169,7 +197,7 @@ var _ = Describe(`IamIdentityV1`, func() { fmt.Fprintf(res, `} this is not valid json {`) })) }) - It(`Invoke ListApiKeys with error: Operation response processing error`, func() { + It(`Invoke ListAPIKeys with error: Operation response processing error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -177,27 +205,27 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the ListApiKeysOptions model - listApiKeysOptionsModel := new(iamidentityv1.ListApiKeysOptions) - listApiKeysOptionsModel.AccountID = core.StringPtr("testString") - listApiKeysOptionsModel.IamID = core.StringPtr("testString") - listApiKeysOptionsModel.Pagesize = core.Int64Ptr(int64(38)) - listApiKeysOptionsModel.Pagetoken = core.StringPtr("testString") - listApiKeysOptionsModel.Scope = core.StringPtr("entity") - listApiKeysOptionsModel.Type = core.StringPtr("user") - listApiKeysOptionsModel.Sort = core.StringPtr("testString") - listApiKeysOptionsModel.Order = core.StringPtr("asc") - listApiKeysOptionsModel.IncludeHistory = core.BoolPtr(true) - listApiKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListAPIKeysOptions model + listAPIKeysOptionsModel := new(iamidentityv1.ListAPIKeysOptions) + listAPIKeysOptionsModel.AccountID = core.StringPtr("testString") + listAPIKeysOptionsModel.IamID = core.StringPtr("testString") + listAPIKeysOptionsModel.Pagesize = core.Int64Ptr(int64(38)) + listAPIKeysOptionsModel.Pagetoken = core.StringPtr("testString") + listAPIKeysOptionsModel.Scope = core.StringPtr("entity") + listAPIKeysOptionsModel.Type = core.StringPtr("user") + listAPIKeysOptionsModel.Sort = core.StringPtr("testString") + listAPIKeysOptionsModel.Order = core.StringPtr("asc") + listAPIKeysOptionsModel.IncludeHistory = core.BoolPtr(true) + listAPIKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.ListApiKeys(listApiKeysOptionsModel) + result, response, operationErr := iamIdentityService.ListAPIKeys(listAPIKeysOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.ListApiKeys(listApiKeysOptionsModel) + result, response, operationErr = iamIdentityService.ListAPIKeys(listAPIKeysOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -208,8 +236,8 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`ListApiKeys(listApiKeysOptions *ListApiKeysOptions)`, func() { - listApiKeysPath := "/v1/apikeys" + Describe(`ListAPIKeys(listAPIKeysOptions *ListAPIKeysOptions)`, func() { + listAPIKeysPath := "/v1/apikeys" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -218,7 +246,7 @@ var _ = Describe(`IamIdentityV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listApiKeysPath)) + Expect(req.URL.EscapedPath()).To(Equal(listAPIKeysPath)) Expect(req.Method).To(Equal("GET")) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) @@ -246,10 +274,10 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 5, "first": "First", "previous": "Previous", "next": "Next", "apikeys": [{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 5, "first": "First", "previous": "Previous", "next": "Next", "apikeys": [{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}]}`) })) }) - It(`Invoke ListApiKeys successfully`, func() { + It(`Invoke ListAPIKeys successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -259,26 +287,26 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - result, response, operationErr := iamIdentityService.ListApiKeys(nil) + result, response, operationErr := iamIdentityService.ListAPIKeys(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the ListApiKeysOptions model - listApiKeysOptionsModel := new(iamidentityv1.ListApiKeysOptions) - listApiKeysOptionsModel.AccountID = core.StringPtr("testString") - listApiKeysOptionsModel.IamID = core.StringPtr("testString") - listApiKeysOptionsModel.Pagesize = core.Int64Ptr(int64(38)) - listApiKeysOptionsModel.Pagetoken = core.StringPtr("testString") - listApiKeysOptionsModel.Scope = core.StringPtr("entity") - listApiKeysOptionsModel.Type = core.StringPtr("user") - listApiKeysOptionsModel.Sort = core.StringPtr("testString") - listApiKeysOptionsModel.Order = core.StringPtr("asc") - listApiKeysOptionsModel.IncludeHistory = core.BoolPtr(true) - listApiKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListAPIKeysOptions model + listAPIKeysOptionsModel := new(iamidentityv1.ListAPIKeysOptions) + listAPIKeysOptionsModel.AccountID = core.StringPtr("testString") + listAPIKeysOptionsModel.IamID = core.StringPtr("testString") + listAPIKeysOptionsModel.Pagesize = core.Int64Ptr(int64(38)) + listAPIKeysOptionsModel.Pagetoken = core.StringPtr("testString") + listAPIKeysOptionsModel.Scope = core.StringPtr("entity") + listAPIKeysOptionsModel.Type = core.StringPtr("user") + listAPIKeysOptionsModel.Sort = core.StringPtr("testString") + listAPIKeysOptionsModel.Order = core.StringPtr("asc") + listAPIKeysOptionsModel.IncludeHistory = core.BoolPtr(true) + listAPIKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.ListApiKeys(listApiKeysOptionsModel) + result, response, operationErr = iamIdentityService.ListAPIKeys(listAPIKeysOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -287,14 +315,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.ListApiKeysWithContext(ctx, listApiKeysOptionsModel) + _, _, operationErr = iamIdentityService.ListAPIKeysWithContext(ctx, listAPIKeysOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.ListApiKeys(listApiKeysOptionsModel) + result, response, operationErr = iamIdentityService.ListAPIKeys(listAPIKeysOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -303,12 +331,12 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.ListApiKeysWithContext(ctx, listApiKeysOptionsModel) + _, _, operationErr = iamIdentityService.ListAPIKeysWithContext(ctx, listAPIKeysOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) }) - It(`Invoke ListApiKeys with error: Operation request error`, func() { + It(`Invoke ListAPIKeys with error: Operation request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -316,22 +344,22 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the ListApiKeysOptions model - listApiKeysOptionsModel := new(iamidentityv1.ListApiKeysOptions) - listApiKeysOptionsModel.AccountID = core.StringPtr("testString") - listApiKeysOptionsModel.IamID = core.StringPtr("testString") - listApiKeysOptionsModel.Pagesize = core.Int64Ptr(int64(38)) - listApiKeysOptionsModel.Pagetoken = core.StringPtr("testString") - listApiKeysOptionsModel.Scope = core.StringPtr("entity") - listApiKeysOptionsModel.Type = core.StringPtr("user") - listApiKeysOptionsModel.Sort = core.StringPtr("testString") - listApiKeysOptionsModel.Order = core.StringPtr("asc") - listApiKeysOptionsModel.IncludeHistory = core.BoolPtr(true) - listApiKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListAPIKeysOptions model + listAPIKeysOptionsModel := new(iamidentityv1.ListAPIKeysOptions) + listAPIKeysOptionsModel.AccountID = core.StringPtr("testString") + listAPIKeysOptionsModel.IamID = core.StringPtr("testString") + listAPIKeysOptionsModel.Pagesize = core.Int64Ptr(int64(38)) + listAPIKeysOptionsModel.Pagetoken = core.StringPtr("testString") + listAPIKeysOptionsModel.Scope = core.StringPtr("entity") + listAPIKeysOptionsModel.Type = core.StringPtr("user") + listAPIKeysOptionsModel.Sort = core.StringPtr("testString") + listAPIKeysOptionsModel.Order = core.StringPtr("asc") + listAPIKeysOptionsModel.IncludeHistory = core.BoolPtr(true) + listAPIKeysOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.ListApiKeys(listApiKeysOptionsModel) + result, response, operationErr := iamIdentityService.ListAPIKeys(listAPIKeysOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) @@ -342,15 +370,15 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`CreateApiKey(createApiKeyOptions *CreateApiKeyOptions) - Operation response error`, func() { - createApiKeyPath := "/v1/apikeys" + Describe(`CreateAPIKey(createAPIKeyOptions *CreateAPIKeyOptions) - Operation response error`, func() { + createAPIKeyPath := "/v1/apikeys" 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(createApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(createAPIKeyPath)) Expect(req.Method).To(Equal("POST")) Expect(req.Header["Entity-Lock"]).ToNot(BeNil()) Expect(req.Header["Entity-Lock"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) @@ -359,7 +387,7 @@ var _ = Describe(`IamIdentityV1`, func() { fmt.Fprintf(res, `} this is not valid json {`) })) }) - It(`Invoke CreateApiKey with error: Operation response processing error`, func() { + It(`Invoke CreateAPIKey with error: Operation response processing error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -367,25 +395,25 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the CreateApiKeyOptions model - createApiKeyOptionsModel := new(iamidentityv1.CreateApiKeyOptions) - createApiKeyOptionsModel.Name = core.StringPtr("testString") - createApiKeyOptionsModel.IamID = core.StringPtr("testString") - createApiKeyOptionsModel.Description = core.StringPtr("testString") - createApiKeyOptionsModel.AccountID = core.StringPtr("testString") - createApiKeyOptionsModel.Apikey = core.StringPtr("testString") - createApiKeyOptionsModel.StoreValue = core.BoolPtr(true) - createApiKeyOptionsModel.EntityLock = core.StringPtr("testString") - createApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the CreateAPIKeyOptions model + createAPIKeyOptionsModel := new(iamidentityv1.CreateAPIKeyOptions) + createAPIKeyOptionsModel.Name = core.StringPtr("testString") + createAPIKeyOptionsModel.IamID = core.StringPtr("testString") + createAPIKeyOptionsModel.Description = core.StringPtr("testString") + createAPIKeyOptionsModel.AccountID = core.StringPtr("testString") + createAPIKeyOptionsModel.Apikey = core.StringPtr("testString") + createAPIKeyOptionsModel.StoreValue = core.BoolPtr(true) + createAPIKeyOptionsModel.EntityLock = core.StringPtr("testString") + createAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.CreateApiKey(createApiKeyOptionsModel) + result, response, operationErr := iamIdentityService.CreateAPIKey(createAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.CreateApiKey(createApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.CreateAPIKey(createAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -396,8 +424,8 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`CreateApiKey(createApiKeyOptions *CreateApiKeyOptions)`, func() { - createApiKeyPath := "/v1/apikeys" + Describe(`CreateAPIKey(createAPIKeyOptions *CreateAPIKeyOptions)`, func() { + createAPIKeyPath := "/v1/apikeys" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -406,7 +434,7 @@ var _ = Describe(`IamIdentityV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(createApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(createAPIKeyPath)) Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -433,10 +461,10 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) })) }) - It(`Invoke CreateApiKey successfully`, func() { + It(`Invoke CreateAPIKey successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -446,24 +474,24 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - result, response, operationErr := iamIdentityService.CreateApiKey(nil) + result, response, operationErr := iamIdentityService.CreateAPIKey(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the CreateApiKeyOptions model - createApiKeyOptionsModel := new(iamidentityv1.CreateApiKeyOptions) - createApiKeyOptionsModel.Name = core.StringPtr("testString") - createApiKeyOptionsModel.IamID = core.StringPtr("testString") - createApiKeyOptionsModel.Description = core.StringPtr("testString") - createApiKeyOptionsModel.AccountID = core.StringPtr("testString") - createApiKeyOptionsModel.Apikey = core.StringPtr("testString") - createApiKeyOptionsModel.StoreValue = core.BoolPtr(true) - createApiKeyOptionsModel.EntityLock = core.StringPtr("testString") - createApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the CreateAPIKeyOptions model + createAPIKeyOptionsModel := new(iamidentityv1.CreateAPIKeyOptions) + createAPIKeyOptionsModel.Name = core.StringPtr("testString") + createAPIKeyOptionsModel.IamID = core.StringPtr("testString") + createAPIKeyOptionsModel.Description = core.StringPtr("testString") + createAPIKeyOptionsModel.AccountID = core.StringPtr("testString") + createAPIKeyOptionsModel.Apikey = core.StringPtr("testString") + createAPIKeyOptionsModel.StoreValue = core.BoolPtr(true) + createAPIKeyOptionsModel.EntityLock = core.StringPtr("testString") + createAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.CreateApiKey(createApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.CreateAPIKey(createAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -472,14 +500,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.CreateApiKeyWithContext(ctx, createApiKeyOptionsModel) + _, _, operationErr = iamIdentityService.CreateAPIKeyWithContext(ctx, createAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.CreateApiKey(createApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.CreateAPIKey(createAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -488,12 +516,12 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.CreateApiKeyWithContext(ctx, createApiKeyOptionsModel) + _, _, operationErr = iamIdentityService.CreateAPIKeyWithContext(ctx, createAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) }) - It(`Invoke CreateApiKey with error: Operation validation and request error`, func() { + It(`Invoke CreateAPIKey with error: Operation validation and request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -501,28 +529,28 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the CreateApiKeyOptions model - createApiKeyOptionsModel := new(iamidentityv1.CreateApiKeyOptions) - createApiKeyOptionsModel.Name = core.StringPtr("testString") - createApiKeyOptionsModel.IamID = core.StringPtr("testString") - createApiKeyOptionsModel.Description = core.StringPtr("testString") - createApiKeyOptionsModel.AccountID = core.StringPtr("testString") - createApiKeyOptionsModel.Apikey = core.StringPtr("testString") - createApiKeyOptionsModel.StoreValue = core.BoolPtr(true) - createApiKeyOptionsModel.EntityLock = core.StringPtr("testString") - createApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the CreateAPIKeyOptions model + createAPIKeyOptionsModel := new(iamidentityv1.CreateAPIKeyOptions) + createAPIKeyOptionsModel.Name = core.StringPtr("testString") + createAPIKeyOptionsModel.IamID = core.StringPtr("testString") + createAPIKeyOptionsModel.Description = core.StringPtr("testString") + createAPIKeyOptionsModel.AccountID = core.StringPtr("testString") + createAPIKeyOptionsModel.Apikey = core.StringPtr("testString") + createAPIKeyOptionsModel.StoreValue = core.BoolPtr(true) + createAPIKeyOptionsModel.EntityLock = core.StringPtr("testString") + createAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.CreateApiKey(createApiKeyOptionsModel) + result, response, operationErr := iamIdentityService.CreateAPIKey(createAPIKeyOptionsModel) 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 CreateApiKeyOptions model with no property values - createApiKeyOptionsModelNew := new(iamidentityv1.CreateApiKeyOptions) + // Construct a second instance of the CreateAPIKeyOptions model with no property values + createAPIKeyOptionsModelNew := new(iamidentityv1.CreateAPIKeyOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = iamIdentityService.CreateApiKey(createApiKeyOptionsModelNew) + result, response, operationErr = iamIdentityService.CreateAPIKey(createAPIKeyOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -532,15 +560,15 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`GetApiKeysDetails(getApiKeysDetailsOptions *GetApiKeysDetailsOptions) - Operation response error`, func() { - getApiKeysDetailsPath := "/v1/apikeys/details" + Describe(`GetAPIKeysDetails(getAPIKeysDetailsOptions *GetAPIKeysDetailsOptions) - Operation response error`, func() { + getAPIKeysDetailsPath := "/v1/apikeys/details" 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(getApiKeysDetailsPath)) + Expect(req.URL.EscapedPath()).To(Equal(getAPIKeysDetailsPath)) Expect(req.Method).To(Equal("GET")) Expect(req.Header["Iam-Apikey"]).ToNot(BeNil()) Expect(req.Header["Iam-Apikey"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) @@ -552,7 +580,7 @@ var _ = Describe(`IamIdentityV1`, func() { fmt.Fprintf(res, `} this is not valid json {`) })) }) - It(`Invoke GetApiKeysDetails with error: Operation response processing error`, func() { + It(`Invoke GetAPIKeysDetails with error: Operation response processing error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -560,20 +588,20 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the GetApiKeysDetailsOptions model - getApiKeysDetailsOptionsModel := new(iamidentityv1.GetApiKeysDetailsOptions) - getApiKeysDetailsOptionsModel.IAMApiKey = core.StringPtr("testString") - getApiKeysDetailsOptionsModel.IncludeHistory = core.BoolPtr(true) - getApiKeysDetailsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetAPIKeysDetailsOptions model + getAPIKeysDetailsOptionsModel := new(iamidentityv1.GetAPIKeysDetailsOptions) + getAPIKeysDetailsOptionsModel.IamAPIKey = core.StringPtr("testString") + getAPIKeysDetailsOptionsModel.IncludeHistory = core.BoolPtr(true) + getAPIKeysDetailsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptionsModel) + result, response, operationErr := iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptionsModel) + result, response, operationErr = iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -584,8 +612,8 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`GetApiKeysDetails(getApiKeysDetailsOptions *GetApiKeysDetailsOptions)`, func() { - getApiKeysDetailsPath := "/v1/apikeys/details" + Describe(`GetAPIKeysDetails(getAPIKeysDetailsOptions *GetAPIKeysDetailsOptions)`, func() { + getAPIKeysDetailsPath := "/v1/apikeys/details" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -594,7 +622,7 @@ var _ = Describe(`IamIdentityV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getApiKeysDetailsPath)) + Expect(req.URL.EscapedPath()).To(Equal(getAPIKeysDetailsPath)) Expect(req.Method).To(Equal("GET")) Expect(req.Header["Iam-Apikey"]).ToNot(BeNil()) @@ -608,10 +636,10 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) })) }) - It(`Invoke GetApiKeysDetails successfully`, func() { + It(`Invoke GetAPIKeysDetails successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -621,19 +649,19 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - result, response, operationErr := iamIdentityService.GetApiKeysDetails(nil) + result, response, operationErr := iamIdentityService.GetAPIKeysDetails(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetApiKeysDetailsOptions model - getApiKeysDetailsOptionsModel := new(iamidentityv1.GetApiKeysDetailsOptions) - getApiKeysDetailsOptionsModel.IAMApiKey = core.StringPtr("testString") - getApiKeysDetailsOptionsModel.IncludeHistory = core.BoolPtr(true) - getApiKeysDetailsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetAPIKeysDetailsOptions model + getAPIKeysDetailsOptionsModel := new(iamidentityv1.GetAPIKeysDetailsOptions) + getAPIKeysDetailsOptionsModel.IamAPIKey = core.StringPtr("testString") + getAPIKeysDetailsOptionsModel.IncludeHistory = core.BoolPtr(true) + getAPIKeysDetailsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptionsModel) + result, response, operationErr = iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -642,14 +670,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.GetApiKeysDetailsWithContext(ctx, getApiKeysDetailsOptionsModel) + _, _, operationErr = iamIdentityService.GetAPIKeysDetailsWithContext(ctx, getAPIKeysDetailsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptionsModel) + result, response, operationErr = iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -658,12 +686,12 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.GetApiKeysDetailsWithContext(ctx, getApiKeysDetailsOptionsModel) + _, _, operationErr = iamIdentityService.GetAPIKeysDetailsWithContext(ctx, getAPIKeysDetailsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) }) - It(`Invoke GetApiKeysDetails with error: Operation request error`, func() { + It(`Invoke GetAPIKeysDetails with error: Operation request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -671,15 +699,15 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the GetApiKeysDetailsOptions model - getApiKeysDetailsOptionsModel := new(iamidentityv1.GetApiKeysDetailsOptions) - getApiKeysDetailsOptionsModel.IAMApiKey = core.StringPtr("testString") - getApiKeysDetailsOptionsModel.IncludeHistory = core.BoolPtr(true) - getApiKeysDetailsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetAPIKeysDetailsOptions model + getAPIKeysDetailsOptionsModel := new(iamidentityv1.GetAPIKeysDetailsOptions) + getAPIKeysDetailsOptionsModel.IamAPIKey = core.StringPtr("testString") + getAPIKeysDetailsOptionsModel.IncludeHistory = core.BoolPtr(true) + getAPIKeysDetailsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.GetApiKeysDetails(getApiKeysDetailsOptionsModel) + result, response, operationErr := iamIdentityService.GetAPIKeysDetails(getAPIKeysDetailsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) @@ -690,15 +718,15 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`GetApiKey(getApiKeyOptions *GetApiKeyOptions) - Operation response error`, func() { - getApiKeyPath := "/v1/apikeys/testString" + Describe(`GetAPIKey(getAPIKeyOptions *GetAPIKeyOptions) - Operation response error`, func() { + getAPIKeyPath := "/v1/apikeys/testString" 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(getApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(getAPIKeyPath)) Expect(req.Method).To(Equal("GET")) // TODO: Add check for include_history query parameter @@ -708,7 +736,7 @@ var _ = Describe(`IamIdentityV1`, func() { fmt.Fprintf(res, `} this is not valid json {`) })) }) - It(`Invoke GetApiKey with error: Operation response processing error`, func() { + It(`Invoke GetAPIKey with error: Operation response processing error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -716,20 +744,20 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the GetApiKeyOptions model - getApiKeyOptionsModel := new(iamidentityv1.GetApiKeyOptions) - getApiKeyOptionsModel.ID = core.StringPtr("testString") - getApiKeyOptionsModel.IncludeHistory = core.BoolPtr(true) - getApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetAPIKeyOptions model + getAPIKeyOptionsModel := new(iamidentityv1.GetAPIKeyOptions) + getAPIKeyOptionsModel.ID = core.StringPtr("testString") + getAPIKeyOptionsModel.IncludeHistory = core.BoolPtr(true) + getAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.GetApiKey(getApiKeyOptionsModel) + result, response, operationErr := iamIdentityService.GetAPIKey(getAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.GetApiKey(getApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.GetAPIKey(getAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -740,8 +768,8 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`GetApiKey(getApiKeyOptions *GetApiKeyOptions)`, func() { - getApiKeyPath := "/v1/apikeys/testString" + Describe(`GetAPIKey(getAPIKeyOptions *GetAPIKeyOptions)`, func() { + getAPIKeyPath := "/v1/apikeys/testString" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -750,7 +778,7 @@ var _ = Describe(`IamIdentityV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(getAPIKeyPath)) Expect(req.Method).To(Equal("GET")) @@ -762,10 +790,10 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) })) }) - It(`Invoke GetApiKey successfully`, func() { + It(`Invoke GetAPIKey successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -775,19 +803,19 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - result, response, operationErr := iamIdentityService.GetApiKey(nil) + result, response, operationErr := iamIdentityService.GetAPIKey(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetApiKeyOptions model - getApiKeyOptionsModel := new(iamidentityv1.GetApiKeyOptions) - getApiKeyOptionsModel.ID = core.StringPtr("testString") - getApiKeyOptionsModel.IncludeHistory = core.BoolPtr(true) - getApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetAPIKeyOptions model + getAPIKeyOptionsModel := new(iamidentityv1.GetAPIKeyOptions) + getAPIKeyOptionsModel.ID = core.StringPtr("testString") + getAPIKeyOptionsModel.IncludeHistory = core.BoolPtr(true) + getAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.GetApiKey(getApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.GetAPIKey(getAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -796,14 +824,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.GetApiKeyWithContext(ctx, getApiKeyOptionsModel) + _, _, operationErr = iamIdentityService.GetAPIKeyWithContext(ctx, getAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.GetApiKey(getApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.GetAPIKey(getAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -812,12 +840,12 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.GetApiKeyWithContext(ctx, getApiKeyOptionsModel) + _, _, operationErr = iamIdentityService.GetAPIKeyWithContext(ctx, getAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) }) - It(`Invoke GetApiKey with error: Operation validation and request error`, func() { + It(`Invoke GetAPIKey with error: Operation validation and request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -825,23 +853,23 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the GetApiKeyOptions model - getApiKeyOptionsModel := new(iamidentityv1.GetApiKeyOptions) - getApiKeyOptionsModel.ID = core.StringPtr("testString") - getApiKeyOptionsModel.IncludeHistory = core.BoolPtr(true) - getApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetAPIKeyOptions model + getAPIKeyOptionsModel := new(iamidentityv1.GetAPIKeyOptions) + getAPIKeyOptionsModel.ID = core.StringPtr("testString") + getAPIKeyOptionsModel.IncludeHistory = core.BoolPtr(true) + getAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.GetApiKey(getApiKeyOptionsModel) + result, response, operationErr := iamIdentityService.GetAPIKey(getAPIKeyOptionsModel) 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 GetApiKeyOptions model with no property values - getApiKeyOptionsModelNew := new(iamidentityv1.GetApiKeyOptions) + // Construct a second instance of the GetAPIKeyOptions model with no property values + getAPIKeyOptionsModelNew := new(iamidentityv1.GetAPIKeyOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = iamIdentityService.GetApiKey(getApiKeyOptionsModelNew) + result, response, operationErr = iamIdentityService.GetAPIKey(getAPIKeyOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -851,15 +879,15 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`UpdateApiKey(updateApiKeyOptions *UpdateApiKeyOptions) - Operation response error`, func() { - updateApiKeyPath := "/v1/apikeys/testString" + Describe(`UpdateAPIKey(updateAPIKeyOptions *UpdateAPIKeyOptions) - Operation response error`, func() { + updateAPIKeyPath := "/v1/apikeys/testString" 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(updateApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(updateAPIKeyPath)) Expect(req.Method).To(Equal("PUT")) Expect(req.Header["If-Match"]).ToNot(BeNil()) Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) @@ -868,7 +896,7 @@ var _ = Describe(`IamIdentityV1`, func() { fmt.Fprintf(res, `} this is not valid json {`) })) }) - It(`Invoke UpdateApiKey with error: Operation response processing error`, func() { + It(`Invoke UpdateAPIKey with error: Operation response processing error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -876,22 +904,22 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the UpdateApiKeyOptions model - updateApiKeyOptionsModel := new(iamidentityv1.UpdateApiKeyOptions) - updateApiKeyOptionsModel.ID = core.StringPtr("testString") - updateApiKeyOptionsModel.IfMatch = core.StringPtr("testString") - updateApiKeyOptionsModel.Name = core.StringPtr("testString") - updateApiKeyOptionsModel.Description = core.StringPtr("testString") - updateApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UpdateAPIKeyOptions model + updateAPIKeyOptionsModel := new(iamidentityv1.UpdateAPIKeyOptions) + updateAPIKeyOptionsModel.ID = core.StringPtr("testString") + updateAPIKeyOptionsModel.IfMatch = core.StringPtr("testString") + updateAPIKeyOptionsModel.Name = core.StringPtr("testString") + updateAPIKeyOptionsModel.Description = core.StringPtr("testString") + updateAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.UpdateApiKey(updateApiKeyOptionsModel) + result, response, operationErr := iamIdentityService.UpdateAPIKey(updateAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.UpdateApiKey(updateApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.UpdateAPIKey(updateAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -902,8 +930,8 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`UpdateApiKey(updateApiKeyOptions *UpdateApiKeyOptions)`, func() { - updateApiKeyPath := "/v1/apikeys/testString" + Describe(`UpdateAPIKey(updateAPIKeyOptions *UpdateAPIKeyOptions)`, func() { + updateAPIKeyPath := "/v1/apikeys/testString" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -912,7 +940,7 @@ var _ = Describe(`IamIdentityV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(updateApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(updateAPIKeyPath)) Expect(req.Method).To(Equal("PUT")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -939,10 +967,10 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}`) })) }) - It(`Invoke UpdateApiKey successfully`, func() { + It(`Invoke UpdateAPIKey successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -952,21 +980,21 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - result, response, operationErr := iamIdentityService.UpdateApiKey(nil) + result, response, operationErr := iamIdentityService.UpdateAPIKey(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the UpdateApiKeyOptions model - updateApiKeyOptionsModel := new(iamidentityv1.UpdateApiKeyOptions) - updateApiKeyOptionsModel.ID = core.StringPtr("testString") - updateApiKeyOptionsModel.IfMatch = core.StringPtr("testString") - updateApiKeyOptionsModel.Name = core.StringPtr("testString") - updateApiKeyOptionsModel.Description = core.StringPtr("testString") - updateApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UpdateAPIKeyOptions model + updateAPIKeyOptionsModel := new(iamidentityv1.UpdateAPIKeyOptions) + updateAPIKeyOptionsModel.ID = core.StringPtr("testString") + updateAPIKeyOptionsModel.IfMatch = core.StringPtr("testString") + updateAPIKeyOptionsModel.Name = core.StringPtr("testString") + updateAPIKeyOptionsModel.Description = core.StringPtr("testString") + updateAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.UpdateApiKey(updateApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.UpdateAPIKey(updateAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -975,14 +1003,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.UpdateApiKeyWithContext(ctx, updateApiKeyOptionsModel) + _, _, operationErr = iamIdentityService.UpdateAPIKeyWithContext(ctx, updateAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.UpdateApiKey(updateApiKeyOptionsModel) + result, response, operationErr = iamIdentityService.UpdateAPIKey(updateAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -991,12 +1019,12 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.UpdateApiKeyWithContext(ctx, updateApiKeyOptionsModel) + _, _, operationErr = iamIdentityService.UpdateAPIKeyWithContext(ctx, updateAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) }) - It(`Invoke UpdateApiKey with error: Operation validation and request error`, func() { + It(`Invoke UpdateAPIKey with error: Operation validation and request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1004,25 +1032,25 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the UpdateApiKeyOptions model - updateApiKeyOptionsModel := new(iamidentityv1.UpdateApiKeyOptions) - updateApiKeyOptionsModel.ID = core.StringPtr("testString") - updateApiKeyOptionsModel.IfMatch = core.StringPtr("testString") - updateApiKeyOptionsModel.Name = core.StringPtr("testString") - updateApiKeyOptionsModel.Description = core.StringPtr("testString") - updateApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UpdateAPIKeyOptions model + updateAPIKeyOptionsModel := new(iamidentityv1.UpdateAPIKeyOptions) + updateAPIKeyOptionsModel.ID = core.StringPtr("testString") + updateAPIKeyOptionsModel.IfMatch = core.StringPtr("testString") + updateAPIKeyOptionsModel.Name = core.StringPtr("testString") + updateAPIKeyOptionsModel.Description = core.StringPtr("testString") + updateAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.UpdateApiKey(updateApiKeyOptionsModel) + result, response, operationErr := iamIdentityService.UpdateAPIKey(updateAPIKeyOptionsModel) 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 UpdateApiKeyOptions model with no property values - updateApiKeyOptionsModelNew := new(iamidentityv1.UpdateApiKeyOptions) + // Construct a second instance of the UpdateAPIKeyOptions model with no property values + updateAPIKeyOptionsModelNew := new(iamidentityv1.UpdateAPIKeyOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = iamIdentityService.UpdateApiKey(updateApiKeyOptionsModelNew) + result, response, operationErr = iamIdentityService.UpdateAPIKey(updateAPIKeyOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -1033,21 +1061,21 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`DeleteApiKey(deleteApiKeyOptions *DeleteApiKeyOptions)`, func() { - deleteApiKeyPath := "/v1/apikeys/testString" + Describe(`DeleteAPIKey(deleteAPIKeyOptions *DeleteAPIKeyOptions)`, func() { + deleteAPIKeyPath := "/v1/apikeys/testString" 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(deleteApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(deleteAPIKeyPath)) Expect(req.Method).To(Equal("DELETE")) res.WriteHeader(204) })) }) - It(`Invoke DeleteApiKey successfully`, func() { + It(`Invoke DeleteAPIKey successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1057,27 +1085,27 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - response, operationErr := iamIdentityService.DeleteApiKey(nil) + response, operationErr := iamIdentityService.DeleteAPIKey(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the DeleteApiKeyOptions model - deleteApiKeyOptionsModel := new(iamidentityv1.DeleteApiKeyOptions) - deleteApiKeyOptionsModel.ID = core.StringPtr("testString") - deleteApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeleteAPIKeyOptions model + deleteAPIKeyOptionsModel := new(iamidentityv1.DeleteAPIKeyOptions) + deleteAPIKeyOptionsModel.ID = core.StringPtr("testString") + deleteAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = iamIdentityService.DeleteApiKey(deleteApiKeyOptionsModel) + response, operationErr = iamIdentityService.DeleteAPIKey(deleteAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) // Disable retries and test again iamIdentityService.DisableRetries() - response, operationErr = iamIdentityService.DeleteApiKey(deleteApiKeyOptionsModel) + response, operationErr = iamIdentityService.DeleteAPIKey(deleteAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) - It(`Invoke DeleteApiKey with error: Operation validation and request error`, func() { + It(`Invoke DeleteAPIKey with error: Operation validation and request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1085,21 +1113,21 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the DeleteApiKeyOptions model - deleteApiKeyOptionsModel := new(iamidentityv1.DeleteApiKeyOptions) - deleteApiKeyOptionsModel.ID = core.StringPtr("testString") - deleteApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeleteAPIKeyOptions model + deleteAPIKeyOptionsModel := new(iamidentityv1.DeleteAPIKeyOptions) + deleteAPIKeyOptionsModel.ID = core.StringPtr("testString") + deleteAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := iamIdentityService.DeleteApiKey(deleteApiKeyOptionsModel) + response, operationErr := iamIdentityService.DeleteAPIKey(deleteAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the DeleteApiKeyOptions model with no property values - deleteApiKeyOptionsModelNew := new(iamidentityv1.DeleteApiKeyOptions) + // Construct a second instance of the DeleteAPIKeyOptions model with no property values + deleteAPIKeyOptionsModelNew := new(iamidentityv1.DeleteAPIKeyOptions) // Invoke operation with invalid model (negative test) - response, operationErr = iamIdentityService.DeleteApiKey(deleteApiKeyOptionsModelNew) + response, operationErr = iamIdentityService.DeleteAPIKey(deleteAPIKeyOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -1109,21 +1137,21 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`LockApiKey(lockApiKeyOptions *LockApiKeyOptions)`, func() { - lockApiKeyPath := "/v1/apikeys/testString/lock" + Describe(`LockAPIKey(lockAPIKeyOptions *LockAPIKeyOptions)`, func() { + lockAPIKeyPath := "/v1/apikeys/testString/lock" 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(lockApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(lockAPIKeyPath)) Expect(req.Method).To(Equal("POST")) res.WriteHeader(204) })) }) - It(`Invoke LockApiKey successfully`, func() { + It(`Invoke LockAPIKey successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1133,27 +1161,27 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - response, operationErr := iamIdentityService.LockApiKey(nil) + response, operationErr := iamIdentityService.LockAPIKey(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the LockApiKeyOptions model - lockApiKeyOptionsModel := new(iamidentityv1.LockApiKeyOptions) - lockApiKeyOptionsModel.ID = core.StringPtr("testString") - lockApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the LockAPIKeyOptions model + lockAPIKeyOptionsModel := new(iamidentityv1.LockAPIKeyOptions) + lockAPIKeyOptionsModel.ID = core.StringPtr("testString") + lockAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = iamIdentityService.LockApiKey(lockApiKeyOptionsModel) + response, operationErr = iamIdentityService.LockAPIKey(lockAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) // Disable retries and test again iamIdentityService.DisableRetries() - response, operationErr = iamIdentityService.LockApiKey(lockApiKeyOptionsModel) + response, operationErr = iamIdentityService.LockAPIKey(lockAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) - It(`Invoke LockApiKey with error: Operation validation and request error`, func() { + It(`Invoke LockAPIKey with error: Operation validation and request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1161,21 +1189,21 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the LockApiKeyOptions model - lockApiKeyOptionsModel := new(iamidentityv1.LockApiKeyOptions) - lockApiKeyOptionsModel.ID = core.StringPtr("testString") - lockApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the LockAPIKeyOptions model + lockAPIKeyOptionsModel := new(iamidentityv1.LockAPIKeyOptions) + lockAPIKeyOptionsModel.ID = core.StringPtr("testString") + lockAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := iamIdentityService.LockApiKey(lockApiKeyOptionsModel) + response, operationErr := iamIdentityService.LockAPIKey(lockAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the LockApiKeyOptions model with no property values - lockApiKeyOptionsModelNew := new(iamidentityv1.LockApiKeyOptions) + // Construct a second instance of the LockAPIKeyOptions model with no property values + lockAPIKeyOptionsModelNew := new(iamidentityv1.LockAPIKeyOptions) // Invoke operation with invalid model (negative test) - response, operationErr = iamIdentityService.LockApiKey(lockApiKeyOptionsModelNew) + response, operationErr = iamIdentityService.LockAPIKey(lockAPIKeyOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -1185,21 +1213,21 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`UnlockApiKey(unlockApiKeyOptions *UnlockApiKeyOptions)`, func() { - unlockApiKeyPath := "/v1/apikeys/testString/lock" + Describe(`UnlockAPIKey(unlockAPIKeyOptions *UnlockAPIKeyOptions)`, func() { + unlockAPIKeyPath := "/v1/apikeys/testString/lock" 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(unlockApiKeyPath)) + Expect(req.URL.EscapedPath()).To(Equal(unlockAPIKeyPath)) Expect(req.Method).To(Equal("DELETE")) res.WriteHeader(204) })) }) - It(`Invoke UnlockApiKey successfully`, func() { + It(`Invoke UnlockAPIKey successfully`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1209,27 +1237,27 @@ var _ = Describe(`IamIdentityV1`, func() { iamIdentityService.EnableRetries(0, 0) // Invoke operation with nil options model (negative test) - response, operationErr := iamIdentityService.UnlockApiKey(nil) + response, operationErr := iamIdentityService.UnlockAPIKey(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the UnlockApiKeyOptions model - unlockApiKeyOptionsModel := new(iamidentityv1.UnlockApiKeyOptions) - unlockApiKeyOptionsModel.ID = core.StringPtr("testString") - unlockApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UnlockAPIKeyOptions model + unlockAPIKeyOptionsModel := new(iamidentityv1.UnlockAPIKeyOptions) + unlockAPIKeyOptionsModel.ID = core.StringPtr("testString") + unlockAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = iamIdentityService.UnlockApiKey(unlockApiKeyOptionsModel) + response, operationErr = iamIdentityService.UnlockAPIKey(unlockAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) // Disable retries and test again iamIdentityService.DisableRetries() - response, operationErr = iamIdentityService.UnlockApiKey(unlockApiKeyOptionsModel) + response, operationErr = iamIdentityService.UnlockAPIKey(unlockAPIKeyOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) - It(`Invoke UnlockApiKey with error: Operation validation and request error`, func() { + It(`Invoke UnlockAPIKey with error: Operation validation and request error`, func() { iamIdentityService, serviceErr := iamidentityv1.NewIamIdentityV1(&iamidentityv1.IamIdentityV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -1237,21 +1265,21 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the UnlockApiKeyOptions model - unlockApiKeyOptionsModel := new(iamidentityv1.UnlockApiKeyOptions) - unlockApiKeyOptionsModel.ID = core.StringPtr("testString") - unlockApiKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UnlockAPIKeyOptions model + unlockAPIKeyOptionsModel := new(iamidentityv1.UnlockAPIKeyOptions) + unlockAPIKeyOptionsModel.ID = core.StringPtr("testString") + unlockAPIKeyOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := iamIdentityService.UnlockApiKey(unlockApiKeyOptionsModel) + response, operationErr := iamIdentityService.UnlockAPIKey(unlockAPIKeyOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the UnlockApiKeyOptions model with no property values - unlockApiKeyOptionsModelNew := new(iamidentityv1.UnlockApiKeyOptions) + // Construct a second instance of the UnlockAPIKeyOptions model with no property values + unlockAPIKeyOptionsModelNew := new(iamidentityv1.UnlockAPIKeyOptions) // Invoke operation with invalid model (negative test) - response, operationErr = iamIdentityService.UnlockApiKey(unlockApiKeyOptionsModelNew) + response, operationErr = iamIdentityService.UnlockAPIKey(unlockAPIKeyOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -1361,7 +1389,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 5, "first": "First", "previous": "Previous", "next": "Next", "serviceids": [{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}]}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "offset": 6, "limit": 5, "first": "First", "previous": "Previous", "next": "Next", "serviceids": [{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}]}`) })) }) It(`Invoke ListServiceIds successfully`, func() { @@ -1453,7 +1481,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`CreateServiceID(createServiceIdOptions *CreateServiceIdOptions) - Operation response error`, func() { + Describe(`CreateServiceID(createServiceIDOptions *CreateServiceIDOptions) - Operation response error`, func() { createServiceIDPath := "/v1/serviceids/" Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -1478,31 +1506,31 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the ApiKeyInsideCreateServiceIdRequest model - apiKeyInsideCreateServiceIdRequestModel := new(iamidentityv1.ApiKeyInsideCreateServiceIdRequest) - apiKeyInsideCreateServiceIdRequestModel.Name = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Description = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Apikey = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.StoreValue = core.BoolPtr(true) - - // Construct an instance of the CreateServiceIdOptions model - createServiceIdOptionsModel := new(iamidentityv1.CreateServiceIdOptions) - createServiceIdOptionsModel.AccountID = core.StringPtr("testString") - createServiceIdOptionsModel.Name = core.StringPtr("testString") - createServiceIdOptionsModel.Description = core.StringPtr("testString") - createServiceIdOptionsModel.UniqueInstanceCrns = []string{"testString"} - createServiceIdOptionsModel.Apikey = apiKeyInsideCreateServiceIdRequestModel - createServiceIdOptionsModel.EntityLock = core.StringPtr("testString") - createServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the APIKeyInsideCreateServiceIDRequest model + apiKeyInsideCreateServiceIDRequestModel := new(iamidentityv1.APIKeyInsideCreateServiceIDRequest) + apiKeyInsideCreateServiceIDRequestModel.Name = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Description = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Apikey = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.StoreValue = core.BoolPtr(true) + + // Construct an instance of the CreateServiceIDOptions model + createServiceIDOptionsModel := new(iamidentityv1.CreateServiceIDOptions) + createServiceIDOptionsModel.AccountID = core.StringPtr("testString") + createServiceIDOptionsModel.Name = core.StringPtr("testString") + createServiceIDOptionsModel.Description = core.StringPtr("testString") + createServiceIDOptionsModel.UniqueInstanceCrns = []string{"testString"} + createServiceIDOptionsModel.Apikey = apiKeyInsideCreateServiceIDRequestModel + createServiceIDOptionsModel.EntityLock = core.StringPtr("testString") + createServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.CreateServiceID(createServiceIdOptionsModel) + result, response, operationErr := iamIdentityService.CreateServiceID(createServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -1513,7 +1541,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`CreateServiceID(createServiceIdOptions *CreateServiceIdOptions)`, func() { + Describe(`CreateServiceID(createServiceIDOptions *CreateServiceIDOptions)`, func() { createServiceIDPath := "/v1/serviceids/" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { @@ -1550,7 +1578,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}`) })) }) It(`Invoke CreateServiceID successfully`, func() { @@ -1568,25 +1596,25 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the ApiKeyInsideCreateServiceIdRequest model - apiKeyInsideCreateServiceIdRequestModel := new(iamidentityv1.ApiKeyInsideCreateServiceIdRequest) - apiKeyInsideCreateServiceIdRequestModel.Name = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Description = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Apikey = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.StoreValue = core.BoolPtr(true) - - // Construct an instance of the CreateServiceIdOptions model - createServiceIdOptionsModel := new(iamidentityv1.CreateServiceIdOptions) - createServiceIdOptionsModel.AccountID = core.StringPtr("testString") - createServiceIdOptionsModel.Name = core.StringPtr("testString") - createServiceIdOptionsModel.Description = core.StringPtr("testString") - createServiceIdOptionsModel.UniqueInstanceCrns = []string{"testString"} - createServiceIdOptionsModel.Apikey = apiKeyInsideCreateServiceIdRequestModel - createServiceIdOptionsModel.EntityLock = core.StringPtr("testString") - createServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the APIKeyInsideCreateServiceIDRequest model + apiKeyInsideCreateServiceIDRequestModel := new(iamidentityv1.APIKeyInsideCreateServiceIDRequest) + apiKeyInsideCreateServiceIDRequestModel.Name = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Description = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Apikey = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.StoreValue = core.BoolPtr(true) + + // Construct an instance of the CreateServiceIDOptions model + createServiceIDOptionsModel := new(iamidentityv1.CreateServiceIDOptions) + createServiceIDOptionsModel.AccountID = core.StringPtr("testString") + createServiceIDOptionsModel.Name = core.StringPtr("testString") + createServiceIDOptionsModel.Description = core.StringPtr("testString") + createServiceIDOptionsModel.UniqueInstanceCrns = []string{"testString"} + createServiceIDOptionsModel.Apikey = apiKeyInsideCreateServiceIDRequestModel + createServiceIDOptionsModel.EntityLock = core.StringPtr("testString") + createServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -1595,14 +1623,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.CreateServiceIDWithContext(ctx, createServiceIdOptionsModel) + _, _, operationErr = iamIdentityService.CreateServiceIDWithContext(ctx, createServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -1611,7 +1639,7 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.CreateServiceIDWithContext(ctx, createServiceIdOptionsModel) + _, _, operationErr = iamIdentityService.CreateServiceIDWithContext(ctx, createServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) @@ -1624,34 +1652,34 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the ApiKeyInsideCreateServiceIdRequest model - apiKeyInsideCreateServiceIdRequestModel := new(iamidentityv1.ApiKeyInsideCreateServiceIdRequest) - apiKeyInsideCreateServiceIdRequestModel.Name = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Description = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Apikey = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.StoreValue = core.BoolPtr(true) - - // Construct an instance of the CreateServiceIdOptions model - createServiceIdOptionsModel := new(iamidentityv1.CreateServiceIdOptions) - createServiceIdOptionsModel.AccountID = core.StringPtr("testString") - createServiceIdOptionsModel.Name = core.StringPtr("testString") - createServiceIdOptionsModel.Description = core.StringPtr("testString") - createServiceIdOptionsModel.UniqueInstanceCrns = []string{"testString"} - createServiceIdOptionsModel.Apikey = apiKeyInsideCreateServiceIdRequestModel - createServiceIdOptionsModel.EntityLock = core.StringPtr("testString") - createServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the APIKeyInsideCreateServiceIDRequest model + apiKeyInsideCreateServiceIDRequestModel := new(iamidentityv1.APIKeyInsideCreateServiceIDRequest) + apiKeyInsideCreateServiceIDRequestModel.Name = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Description = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Apikey = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.StoreValue = core.BoolPtr(true) + + // Construct an instance of the CreateServiceIDOptions model + createServiceIDOptionsModel := new(iamidentityv1.CreateServiceIDOptions) + createServiceIDOptionsModel.AccountID = core.StringPtr("testString") + createServiceIDOptionsModel.Name = core.StringPtr("testString") + createServiceIDOptionsModel.Description = core.StringPtr("testString") + createServiceIDOptionsModel.UniqueInstanceCrns = []string{"testString"} + createServiceIDOptionsModel.Apikey = apiKeyInsideCreateServiceIDRequestModel + createServiceIDOptionsModel.EntityLock = core.StringPtr("testString") + createServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.CreateServiceID(createServiceIdOptionsModel) + result, response, operationErr := iamIdentityService.CreateServiceID(createServiceIDOptionsModel) 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 CreateServiceIdOptions model with no property values - createServiceIdOptionsModelNew := new(iamidentityv1.CreateServiceIdOptions) + // Construct a second instance of the CreateServiceIDOptions model with no property values + createServiceIDOptionsModelNew := new(iamidentityv1.CreateServiceIDOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIdOptionsModelNew) + result, response, operationErr = iamIdentityService.CreateServiceID(createServiceIDOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -1661,7 +1689,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`GetServiceID(getServiceIdOptions *GetServiceIdOptions) - Operation response error`, func() { + Describe(`GetServiceID(getServiceIDOptions *GetServiceIDOptions) - Operation response error`, func() { getServiceIDPath := "/v1/serviceids/testString" Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -1687,20 +1715,20 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the GetServiceIdOptions model - getServiceIdOptionsModel := new(iamidentityv1.GetServiceIdOptions) - getServiceIdOptionsModel.ID = core.StringPtr("testString") - getServiceIdOptionsModel.IncludeHistory = core.BoolPtr(true) - getServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetServiceIDOptions model + getServiceIDOptionsModel := new(iamidentityv1.GetServiceIDOptions) + getServiceIDOptionsModel.ID = core.StringPtr("testString") + getServiceIDOptionsModel.IncludeHistory = core.BoolPtr(true) + getServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.GetServiceID(getServiceIdOptionsModel) + result, response, operationErr := iamIdentityService.GetServiceID(getServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.GetServiceID(getServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.GetServiceID(getServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -1711,7 +1739,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`GetServiceID(getServiceIdOptions *GetServiceIdOptions)`, func() { + Describe(`GetServiceID(getServiceIDOptions *GetServiceIDOptions)`, func() { getServiceIDPath := "/v1/serviceids/testString" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { @@ -1733,7 +1761,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}`) })) }) It(`Invoke GetServiceID successfully`, func() { @@ -1751,14 +1779,14 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetServiceIdOptions model - getServiceIdOptionsModel := new(iamidentityv1.GetServiceIdOptions) - getServiceIdOptionsModel.ID = core.StringPtr("testString") - getServiceIdOptionsModel.IncludeHistory = core.BoolPtr(true) - getServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetServiceIDOptions model + getServiceIDOptionsModel := new(iamidentityv1.GetServiceIDOptions) + getServiceIDOptionsModel.ID = core.StringPtr("testString") + getServiceIDOptionsModel.IncludeHistory = core.BoolPtr(true) + getServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.GetServiceID(getServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.GetServiceID(getServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -1767,14 +1795,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.GetServiceIDWithContext(ctx, getServiceIdOptionsModel) + _, _, operationErr = iamIdentityService.GetServiceIDWithContext(ctx, getServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.GetServiceID(getServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.GetServiceID(getServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -1783,7 +1811,7 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.GetServiceIDWithContext(ctx, getServiceIdOptionsModel) + _, _, operationErr = iamIdentityService.GetServiceIDWithContext(ctx, getServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) @@ -1796,23 +1824,23 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the GetServiceIdOptions model - getServiceIdOptionsModel := new(iamidentityv1.GetServiceIdOptions) - getServiceIdOptionsModel.ID = core.StringPtr("testString") - getServiceIdOptionsModel.IncludeHistory = core.BoolPtr(true) - getServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetServiceIDOptions model + getServiceIDOptionsModel := new(iamidentityv1.GetServiceIDOptions) + getServiceIDOptionsModel.ID = core.StringPtr("testString") + getServiceIDOptionsModel.IncludeHistory = core.BoolPtr(true) + getServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.GetServiceID(getServiceIdOptionsModel) + result, response, operationErr := iamIdentityService.GetServiceID(getServiceIDOptionsModel) 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 GetServiceIdOptions model with no property values - getServiceIdOptionsModelNew := new(iamidentityv1.GetServiceIdOptions) + // Construct a second instance of the GetServiceIDOptions model with no property values + getServiceIDOptionsModelNew := new(iamidentityv1.GetServiceIDOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = iamIdentityService.GetServiceID(getServiceIdOptionsModelNew) + result, response, operationErr = iamIdentityService.GetServiceID(getServiceIDOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -1822,7 +1850,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) }) - Describe(`UpdateServiceID(updateServiceIdOptions *UpdateServiceIdOptions) - Operation response error`, func() { + Describe(`UpdateServiceID(updateServiceIDOptions *UpdateServiceIDOptions) - Operation response error`, func() { updateServiceIDPath := "/v1/serviceids/testString" Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -1847,23 +1875,23 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the UpdateServiceIdOptions model - updateServiceIdOptionsModel := new(iamidentityv1.UpdateServiceIdOptions) - updateServiceIdOptionsModel.ID = core.StringPtr("testString") - updateServiceIdOptionsModel.IfMatch = core.StringPtr("testString") - updateServiceIdOptionsModel.Name = core.StringPtr("testString") - updateServiceIdOptionsModel.Description = core.StringPtr("testString") - updateServiceIdOptionsModel.UniqueInstanceCrns = []string{"testString"} - updateServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UpdateServiceIDOptions model + updateServiceIDOptionsModel := new(iamidentityv1.UpdateServiceIDOptions) + updateServiceIDOptionsModel.ID = core.StringPtr("testString") + updateServiceIDOptionsModel.IfMatch = core.StringPtr("testString") + updateServiceIDOptionsModel.Name = core.StringPtr("testString") + updateServiceIDOptionsModel.Description = core.StringPtr("testString") + updateServiceIDOptionsModel.UniqueInstanceCrns = []string{"testString"} + updateServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := iamIdentityService.UpdateServiceID(updateServiceIdOptionsModel) + result, response, operationErr := iamIdentityService.UpdateServiceID(updateServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again iamIdentityService.EnableRetries(0, 0) - result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -1874,7 +1902,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`UpdateServiceID(updateServiceIdOptions *UpdateServiceIdOptions)`, func() { + Describe(`UpdateServiceID(updateServiceIDOptions *UpdateServiceIDOptions)`, func() { updateServiceIDPath := "/v1/serviceids/testString" var serverSleepTime time.Duration Context(`Using mock server endpoint`, func() { @@ -1911,7 +1939,7 @@ var _ = Describe(`IamIdentityV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "Crn", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIdAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}`) + fmt.Fprintf(res, "%s", `{"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "iam_id": "IamID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "modified_at": "2019-01-01T12:00:00", "account_id": "AccountID", "name": "Name", "description": "Description", "unique_instance_crns": ["UniqueInstanceCrns"], "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}], "apikey": {"context": {"transaction_id": "TransactionID", "operation": "Operation", "user_agent": "UserAgent", "url": "URL", "instance_id": "InstanceID", "thread_id": "ThreadID", "host": "Host", "start_time": "StartTime", "end_time": "EndTime", "elapsed_time": "ElapsedTime", "cluster_name": "ClusterName"}, "id": "ID", "entity_tag": "EntityTag", "crn": "CRN", "locked": true, "created_at": "2019-01-01T12:00:00", "created_by": "CreatedBy", "modified_at": "2019-01-01T12:00:00", "name": "Name", "description": "Description", "iam_id": "IamID", "account_id": "AccountID", "apikey": "Apikey", "history": [{"timestamp": "Timestamp", "iam_id": "IamID", "iam_id_account": "IamIDAccount", "action": "Action", "params": ["Params"], "message": "Message"}]}}`) })) }) It(`Invoke UpdateServiceID successfully`, func() { @@ -1929,17 +1957,17 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the UpdateServiceIdOptions model - updateServiceIdOptionsModel := new(iamidentityv1.UpdateServiceIdOptions) - updateServiceIdOptionsModel.ID = core.StringPtr("testString") - updateServiceIdOptionsModel.IfMatch = core.StringPtr("testString") - updateServiceIdOptionsModel.Name = core.StringPtr("testString") - updateServiceIdOptionsModel.Description = core.StringPtr("testString") - updateServiceIdOptionsModel.UniqueInstanceCrns = []string{"testString"} - updateServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UpdateServiceIDOptions model + updateServiceIDOptionsModel := new(iamidentityv1.UpdateServiceIDOptions) + updateServiceIDOptionsModel.ID = core.StringPtr("testString") + updateServiceIDOptionsModel.IfMatch = core.StringPtr("testString") + updateServiceIDOptionsModel.Name = core.StringPtr("testString") + updateServiceIDOptionsModel.Description = core.StringPtr("testString") + updateServiceIDOptionsModel.UniqueInstanceCrns = []string{"testString"} + updateServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -1948,14 +1976,14 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.UpdateServiceIDWithContext(ctx, updateServiceIdOptionsModel) + _, _, operationErr = iamIdentityService.UpdateServiceIDWithContext(ctx, updateServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) // Disable retries and test again iamIdentityService.DisableRetries() - result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIdOptionsModel) + result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -1964,7 +1992,7 @@ var _ = Describe(`IamIdentityV1`, func() { ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() serverSleepTime = 100 * time.Millisecond - _, _, operationErr = iamIdentityService.UpdateServiceIDWithContext(ctx, updateServiceIdOptionsModel) + _, _, operationErr = iamIdentityService.UpdateServiceIDWithContext(ctx, updateServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) serverSleepTime = time.Duration(0) @@ -1977,26 +2005,26 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the UpdateServiceIdOptions model - updateServiceIdOptionsModel := new(iamidentityv1.UpdateServiceIdOptions) - updateServiceIdOptionsModel.ID = core.StringPtr("testString") - updateServiceIdOptionsModel.IfMatch = core.StringPtr("testString") - updateServiceIdOptionsModel.Name = core.StringPtr("testString") - updateServiceIdOptionsModel.Description = core.StringPtr("testString") - updateServiceIdOptionsModel.UniqueInstanceCrns = []string{"testString"} - updateServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UpdateServiceIDOptions model + updateServiceIDOptionsModel := new(iamidentityv1.UpdateServiceIDOptions) + updateServiceIDOptionsModel.ID = core.StringPtr("testString") + updateServiceIDOptionsModel.IfMatch = core.StringPtr("testString") + updateServiceIDOptionsModel.Name = core.StringPtr("testString") + updateServiceIDOptionsModel.Description = core.StringPtr("testString") + updateServiceIDOptionsModel.UniqueInstanceCrns = []string{"testString"} + updateServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := iamIdentityService.UpdateServiceID(updateServiceIdOptionsModel) + result, response, operationErr := iamIdentityService.UpdateServiceID(updateServiceIDOptionsModel) 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 UpdateServiceIdOptions model with no property values - updateServiceIdOptionsModelNew := new(iamidentityv1.UpdateServiceIdOptions) + // Construct a second instance of the UpdateServiceIDOptions model with no property values + updateServiceIDOptionsModelNew := new(iamidentityv1.UpdateServiceIDOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIdOptionsModelNew) + result, response, operationErr = iamIdentityService.UpdateServiceID(updateServiceIDOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -2007,7 +2035,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`DeleteServiceID(deleteServiceIdOptions *DeleteServiceIdOptions)`, func() { + Describe(`DeleteServiceID(deleteServiceIDOptions *DeleteServiceIDOptions)`, func() { deleteServiceIDPath := "/v1/serviceids/testString" Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -2035,19 +2063,19 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the DeleteServiceIdOptions model - deleteServiceIdOptionsModel := new(iamidentityv1.DeleteServiceIdOptions) - deleteServiceIdOptionsModel.ID = core.StringPtr("testString") - deleteServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeleteServiceIDOptions model + deleteServiceIDOptionsModel := new(iamidentityv1.DeleteServiceIDOptions) + deleteServiceIDOptionsModel.ID = core.StringPtr("testString") + deleteServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = iamIdentityService.DeleteServiceID(deleteServiceIdOptionsModel) + response, operationErr = iamIdentityService.DeleteServiceID(deleteServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) // Disable retries and test again iamIdentityService.DisableRetries() - response, operationErr = iamIdentityService.DeleteServiceID(deleteServiceIdOptionsModel) + response, operationErr = iamIdentityService.DeleteServiceID(deleteServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) @@ -2059,21 +2087,21 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the DeleteServiceIdOptions model - deleteServiceIdOptionsModel := new(iamidentityv1.DeleteServiceIdOptions) - deleteServiceIdOptionsModel.ID = core.StringPtr("testString") - deleteServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeleteServiceIDOptions model + deleteServiceIDOptionsModel := new(iamidentityv1.DeleteServiceIDOptions) + deleteServiceIDOptionsModel.ID = core.StringPtr("testString") + deleteServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := iamIdentityService.DeleteServiceID(deleteServiceIdOptionsModel) + response, operationErr := iamIdentityService.DeleteServiceID(deleteServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the DeleteServiceIdOptions model with no property values - deleteServiceIdOptionsModelNew := new(iamidentityv1.DeleteServiceIdOptions) + // Construct a second instance of the DeleteServiceIDOptions model with no property values + deleteServiceIDOptionsModelNew := new(iamidentityv1.DeleteServiceIDOptions) // Invoke operation with invalid model (negative test) - response, operationErr = iamIdentityService.DeleteServiceID(deleteServiceIdOptionsModelNew) + response, operationErr = iamIdentityService.DeleteServiceID(deleteServiceIDOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -2083,7 +2111,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`LockServiceID(lockServiceIdOptions *LockServiceIdOptions)`, func() { + Describe(`LockServiceID(lockServiceIDOptions *LockServiceIDOptions)`, func() { lockServiceIDPath := "/v1/serviceids/testString/lock" Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -2111,19 +2139,19 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the LockServiceIdOptions model - lockServiceIdOptionsModel := new(iamidentityv1.LockServiceIdOptions) - lockServiceIdOptionsModel.ID = core.StringPtr("testString") - lockServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the LockServiceIDOptions model + lockServiceIDOptionsModel := new(iamidentityv1.LockServiceIDOptions) + lockServiceIDOptionsModel.ID = core.StringPtr("testString") + lockServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = iamIdentityService.LockServiceID(lockServiceIdOptionsModel) + response, operationErr = iamIdentityService.LockServiceID(lockServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) // Disable retries and test again iamIdentityService.DisableRetries() - response, operationErr = iamIdentityService.LockServiceID(lockServiceIdOptionsModel) + response, operationErr = iamIdentityService.LockServiceID(lockServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) @@ -2135,21 +2163,21 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the LockServiceIdOptions model - lockServiceIdOptionsModel := new(iamidentityv1.LockServiceIdOptions) - lockServiceIdOptionsModel.ID = core.StringPtr("testString") - lockServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the LockServiceIDOptions model + lockServiceIDOptionsModel := new(iamidentityv1.LockServiceIDOptions) + lockServiceIDOptionsModel.ID = core.StringPtr("testString") + lockServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := iamIdentityService.LockServiceID(lockServiceIdOptionsModel) + response, operationErr := iamIdentityService.LockServiceID(lockServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the LockServiceIdOptions model with no property values - lockServiceIdOptionsModelNew := new(iamidentityv1.LockServiceIdOptions) + // Construct a second instance of the LockServiceIDOptions model with no property values + lockServiceIDOptionsModelNew := new(iamidentityv1.LockServiceIDOptions) // Invoke operation with invalid model (negative test) - response, operationErr = iamIdentityService.LockServiceID(lockServiceIdOptionsModelNew) + response, operationErr = iamIdentityService.LockServiceID(lockServiceIDOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -2159,7 +2187,7 @@ var _ = Describe(`IamIdentityV1`, func() { }) }) - Describe(`UnlockServiceID(unlockServiceIdOptions *UnlockServiceIdOptions)`, func() { + Describe(`UnlockServiceID(unlockServiceIDOptions *UnlockServiceIDOptions)`, func() { unlockServiceIDPath := "/v1/serviceids/testString/lock" Context(`Using mock server endpoint`, func() { BeforeEach(func() { @@ -2187,19 +2215,19 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the UnlockServiceIdOptions model - unlockServiceIdOptionsModel := new(iamidentityv1.UnlockServiceIdOptions) - unlockServiceIdOptionsModel.ID = core.StringPtr("testString") - unlockServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UnlockServiceIDOptions model + unlockServiceIDOptionsModel := new(iamidentityv1.UnlockServiceIDOptions) + unlockServiceIDOptionsModel.ID = core.StringPtr("testString") + unlockServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = iamIdentityService.UnlockServiceID(unlockServiceIdOptionsModel) + response, operationErr = iamIdentityService.UnlockServiceID(unlockServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) // Disable retries and test again iamIdentityService.DisableRetries() - response, operationErr = iamIdentityService.UnlockServiceID(unlockServiceIdOptionsModel) + response, operationErr = iamIdentityService.UnlockServiceID(unlockServiceIDOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) @@ -2211,21 +2239,21 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(serviceErr).To(BeNil()) Expect(iamIdentityService).ToNot(BeNil()) - // Construct an instance of the UnlockServiceIdOptions model - unlockServiceIdOptionsModel := new(iamidentityv1.UnlockServiceIdOptions) - unlockServiceIdOptionsModel.ID = core.StringPtr("testString") - unlockServiceIdOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the UnlockServiceIDOptions model + unlockServiceIDOptionsModel := new(iamidentityv1.UnlockServiceIDOptions) + unlockServiceIDOptionsModel.ID = core.StringPtr("testString") + unlockServiceIDOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := iamIdentityService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := iamIdentityService.UnlockServiceID(unlockServiceIdOptionsModel) + response, operationErr := iamIdentityService.UnlockServiceID(unlockServiceIDOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the UnlockServiceIdOptions model with no property values - unlockServiceIdOptionsModelNew := new(iamidentityv1.UnlockServiceIdOptions) + // Construct a second instance of the UnlockServiceIDOptions model with no property values + unlockServiceIDOptionsModelNew := new(iamidentityv1.UnlockServiceIDOptions) // Invoke operation with invalid model (negative test) - response, operationErr = iamIdentityService.UnlockServiceID(unlockServiceIdOptionsModelNew) + response, operationErr = iamIdentityService.UnlockServiceID(unlockServiceIDOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -2240,147 +2268,147 @@ var _ = Describe(`IamIdentityV1`, func() { URL: "http://iamidentityv1modelgenerator.com", Authenticator: &core.NoAuthAuthenticator{}, }) - It(`Invoke NewApiKeyInsideCreateServiceIdRequest successfully`, func() { + It(`Invoke NewAPIKeyInsideCreateServiceIDRequest successfully`, func() { name := "testString" - model, err := iamIdentityService.NewApiKeyInsideCreateServiceIdRequest(name) + model, err := iamIdentityService.NewAPIKeyInsideCreateServiceIDRequest(name) Expect(model).ToNot(BeNil()) Expect(err).To(BeNil()) }) - It(`Invoke NewCreateApiKeyOptions successfully`, func() { - // Construct an instance of the CreateApiKeyOptions model - createApiKeyOptionsName := "testString" - createApiKeyOptionsIamID := "testString" - createApiKeyOptionsModel := iamIdentityService.NewCreateApiKeyOptions(createApiKeyOptionsName, createApiKeyOptionsIamID) - createApiKeyOptionsModel.SetName("testString") - createApiKeyOptionsModel.SetIamID("testString") - createApiKeyOptionsModel.SetDescription("testString") - createApiKeyOptionsModel.SetAccountID("testString") - createApiKeyOptionsModel.SetApikey("testString") - createApiKeyOptionsModel.SetStoreValue(true) - createApiKeyOptionsModel.SetEntityLock("testString") - createApiKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createApiKeyOptionsModel).ToNot(BeNil()) - Expect(createApiKeyOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(createApiKeyOptionsModel.IamID).To(Equal(core.StringPtr("testString"))) - Expect(createApiKeyOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(createApiKeyOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) - Expect(createApiKeyOptionsModel.Apikey).To(Equal(core.StringPtr("testString"))) - Expect(createApiKeyOptionsModel.StoreValue).To(Equal(core.BoolPtr(true))) - Expect(createApiKeyOptionsModel.EntityLock).To(Equal(core.StringPtr("testString"))) - Expect(createApiKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewCreateServiceIdOptions successfully`, func() { - // Construct an instance of the ApiKeyInsideCreateServiceIdRequest model - apiKeyInsideCreateServiceIdRequestModel := new(iamidentityv1.ApiKeyInsideCreateServiceIdRequest) - Expect(apiKeyInsideCreateServiceIdRequestModel).ToNot(BeNil()) - apiKeyInsideCreateServiceIdRequestModel.Name = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Description = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.Apikey = core.StringPtr("testString") - apiKeyInsideCreateServiceIdRequestModel.StoreValue = core.BoolPtr(true) - Expect(apiKeyInsideCreateServiceIdRequestModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(apiKeyInsideCreateServiceIdRequestModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(apiKeyInsideCreateServiceIdRequestModel.Apikey).To(Equal(core.StringPtr("testString"))) - Expect(apiKeyInsideCreateServiceIdRequestModel.StoreValue).To(Equal(core.BoolPtr(true))) - - // Construct an instance of the CreateServiceIdOptions model - createServiceIdOptionsAccountID := "testString" - createServiceIdOptionsName := "testString" - createServiceIdOptionsModel := iamIdentityService.NewCreateServiceIdOptions(createServiceIdOptionsAccountID, createServiceIdOptionsName) - createServiceIdOptionsModel.SetAccountID("testString") - createServiceIdOptionsModel.SetName("testString") - createServiceIdOptionsModel.SetDescription("testString") - createServiceIdOptionsModel.SetUniqueInstanceCrns([]string{"testString"}) - createServiceIdOptionsModel.SetApikey(apiKeyInsideCreateServiceIdRequestModel) - createServiceIdOptionsModel.SetEntityLock("testString") - createServiceIdOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createServiceIdOptionsModel).ToNot(BeNil()) - Expect(createServiceIdOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) - Expect(createServiceIdOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(createServiceIdOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(createServiceIdOptionsModel.UniqueInstanceCrns).To(Equal([]string{"testString"})) - Expect(createServiceIdOptionsModel.Apikey).To(Equal(apiKeyInsideCreateServiceIdRequestModel)) - Expect(createServiceIdOptionsModel.EntityLock).To(Equal(core.StringPtr("testString"))) - Expect(createServiceIdOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewDeleteApiKeyOptions successfully`, func() { - // Construct an instance of the DeleteApiKeyOptions model + It(`Invoke NewCreateAPIKeyOptions successfully`, func() { + // Construct an instance of the CreateAPIKeyOptions model + createAPIKeyOptionsName := "testString" + createAPIKeyOptionsIamID := "testString" + createAPIKeyOptionsModel := iamIdentityService.NewCreateAPIKeyOptions(createAPIKeyOptionsName, createAPIKeyOptionsIamID) + createAPIKeyOptionsModel.SetName("testString") + createAPIKeyOptionsModel.SetIamID("testString") + createAPIKeyOptionsModel.SetDescription("testString") + createAPIKeyOptionsModel.SetAccountID("testString") + createAPIKeyOptionsModel.SetApikey("testString") + createAPIKeyOptionsModel.SetStoreValue(true) + createAPIKeyOptionsModel.SetEntityLock("testString") + createAPIKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createAPIKeyOptionsModel).ToNot(BeNil()) + Expect(createAPIKeyOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(createAPIKeyOptionsModel.IamID).To(Equal(core.StringPtr("testString"))) + Expect(createAPIKeyOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(createAPIKeyOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(createAPIKeyOptionsModel.Apikey).To(Equal(core.StringPtr("testString"))) + Expect(createAPIKeyOptionsModel.StoreValue).To(Equal(core.BoolPtr(true))) + Expect(createAPIKeyOptionsModel.EntityLock).To(Equal(core.StringPtr("testString"))) + Expect(createAPIKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCreateServiceIDOptions successfully`, func() { + // Construct an instance of the APIKeyInsideCreateServiceIDRequest model + apiKeyInsideCreateServiceIDRequestModel := new(iamidentityv1.APIKeyInsideCreateServiceIDRequest) + Expect(apiKeyInsideCreateServiceIDRequestModel).ToNot(BeNil()) + apiKeyInsideCreateServiceIDRequestModel.Name = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Description = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.Apikey = core.StringPtr("testString") + apiKeyInsideCreateServiceIDRequestModel.StoreValue = core.BoolPtr(true) + Expect(apiKeyInsideCreateServiceIDRequestModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(apiKeyInsideCreateServiceIDRequestModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(apiKeyInsideCreateServiceIDRequestModel.Apikey).To(Equal(core.StringPtr("testString"))) + Expect(apiKeyInsideCreateServiceIDRequestModel.StoreValue).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the CreateServiceIDOptions model + createServiceIDOptionsAccountID := "testString" + createServiceIDOptionsName := "testString" + createServiceIDOptionsModel := iamIdentityService.NewCreateServiceIDOptions(createServiceIDOptionsAccountID, createServiceIDOptionsName) + createServiceIDOptionsModel.SetAccountID("testString") + createServiceIDOptionsModel.SetName("testString") + createServiceIDOptionsModel.SetDescription("testString") + createServiceIDOptionsModel.SetUniqueInstanceCrns([]string{"testString"}) + createServiceIDOptionsModel.SetApikey(apiKeyInsideCreateServiceIDRequestModel) + createServiceIDOptionsModel.SetEntityLock("testString") + createServiceIDOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createServiceIDOptionsModel).ToNot(BeNil()) + Expect(createServiceIDOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(createServiceIDOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(createServiceIDOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(createServiceIDOptionsModel.UniqueInstanceCrns).To(Equal([]string{"testString"})) + Expect(createServiceIDOptionsModel.Apikey).To(Equal(apiKeyInsideCreateServiceIDRequestModel)) + Expect(createServiceIDOptionsModel.EntityLock).To(Equal(core.StringPtr("testString"))) + Expect(createServiceIDOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteAPIKeyOptions successfully`, func() { + // Construct an instance of the DeleteAPIKeyOptions model id := "testString" - deleteApiKeyOptionsModel := iamIdentityService.NewDeleteApiKeyOptions(id) - deleteApiKeyOptionsModel.SetID("testString") - deleteApiKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteApiKeyOptionsModel).ToNot(BeNil()) - Expect(deleteApiKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(deleteApiKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewDeleteServiceIdOptions successfully`, func() { - // Construct an instance of the DeleteServiceIdOptions model + deleteAPIKeyOptionsModel := iamIdentityService.NewDeleteAPIKeyOptions(id) + deleteAPIKeyOptionsModel.SetID("testString") + deleteAPIKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteAPIKeyOptionsModel).ToNot(BeNil()) + Expect(deleteAPIKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(deleteAPIKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteServiceIDOptions successfully`, func() { + // Construct an instance of the DeleteServiceIDOptions model id := "testString" - deleteServiceIdOptionsModel := iamIdentityService.NewDeleteServiceIdOptions(id) - deleteServiceIdOptionsModel.SetID("testString") - deleteServiceIdOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteServiceIdOptionsModel).ToNot(BeNil()) - Expect(deleteServiceIdOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(deleteServiceIdOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetApiKeyOptions successfully`, func() { - // Construct an instance of the GetApiKeyOptions model + deleteServiceIDOptionsModel := iamIdentityService.NewDeleteServiceIDOptions(id) + deleteServiceIDOptionsModel.SetID("testString") + deleteServiceIDOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteServiceIDOptionsModel).ToNot(BeNil()) + Expect(deleteServiceIDOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(deleteServiceIDOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetAPIKeyOptions successfully`, func() { + // Construct an instance of the GetAPIKeyOptions model id := "testString" - getApiKeyOptionsModel := iamIdentityService.NewGetApiKeyOptions(id) - getApiKeyOptionsModel.SetID("testString") - getApiKeyOptionsModel.SetIncludeHistory(true) - getApiKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getApiKeyOptionsModel).ToNot(BeNil()) - Expect(getApiKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getApiKeyOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) - Expect(getApiKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetApiKeysDetailsOptions successfully`, func() { - // Construct an instance of the GetApiKeysDetailsOptions model - getApiKeysDetailsOptionsModel := iamIdentityService.NewGetApiKeysDetailsOptions() - getApiKeysDetailsOptionsModel.SetIAMApiKey("testString") - getApiKeysDetailsOptionsModel.SetIncludeHistory(true) - getApiKeysDetailsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getApiKeysDetailsOptionsModel).ToNot(BeNil()) - Expect(getApiKeysDetailsOptionsModel.IAMApiKey).To(Equal(core.StringPtr("testString"))) - Expect(getApiKeysDetailsOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) - Expect(getApiKeysDetailsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetServiceIdOptions successfully`, func() { - // Construct an instance of the GetServiceIdOptions model + getAPIKeyOptionsModel := iamIdentityService.NewGetAPIKeyOptions(id) + getAPIKeyOptionsModel.SetID("testString") + getAPIKeyOptionsModel.SetIncludeHistory(true) + getAPIKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getAPIKeyOptionsModel).ToNot(BeNil()) + Expect(getAPIKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(getAPIKeyOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) + Expect(getAPIKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetAPIKeysDetailsOptions successfully`, func() { + // Construct an instance of the GetAPIKeysDetailsOptions model + getAPIKeysDetailsOptionsModel := iamIdentityService.NewGetAPIKeysDetailsOptions() + getAPIKeysDetailsOptionsModel.SetIamAPIKey("testString") + getAPIKeysDetailsOptionsModel.SetIncludeHistory(true) + getAPIKeysDetailsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getAPIKeysDetailsOptionsModel).ToNot(BeNil()) + Expect(getAPIKeysDetailsOptionsModel.IamAPIKey).To(Equal(core.StringPtr("testString"))) + Expect(getAPIKeysDetailsOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) + Expect(getAPIKeysDetailsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetServiceIDOptions successfully`, func() { + // Construct an instance of the GetServiceIDOptions model id := "testString" - getServiceIdOptionsModel := iamIdentityService.NewGetServiceIdOptions(id) - getServiceIdOptionsModel.SetID("testString") - getServiceIdOptionsModel.SetIncludeHistory(true) - getServiceIdOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getServiceIdOptionsModel).ToNot(BeNil()) - Expect(getServiceIdOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getServiceIdOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) - Expect(getServiceIdOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewListApiKeysOptions successfully`, func() { - // Construct an instance of the ListApiKeysOptions model - listApiKeysOptionsModel := iamIdentityService.NewListApiKeysOptions() - listApiKeysOptionsModel.SetAccountID("testString") - listApiKeysOptionsModel.SetIamID("testString") - listApiKeysOptionsModel.SetPagesize(int64(38)) - listApiKeysOptionsModel.SetPagetoken("testString") - listApiKeysOptionsModel.SetScope("entity") - listApiKeysOptionsModel.SetType("user") - listApiKeysOptionsModel.SetSort("testString") - listApiKeysOptionsModel.SetOrder("asc") - listApiKeysOptionsModel.SetIncludeHistory(true) - listApiKeysOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listApiKeysOptionsModel).ToNot(BeNil()) - Expect(listApiKeysOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) - Expect(listApiKeysOptionsModel.IamID).To(Equal(core.StringPtr("testString"))) - Expect(listApiKeysOptionsModel.Pagesize).To(Equal(core.Int64Ptr(int64(38)))) - Expect(listApiKeysOptionsModel.Pagetoken).To(Equal(core.StringPtr("testString"))) - Expect(listApiKeysOptionsModel.Scope).To(Equal(core.StringPtr("entity"))) - Expect(listApiKeysOptionsModel.Type).To(Equal(core.StringPtr("user"))) - Expect(listApiKeysOptionsModel.Sort).To(Equal(core.StringPtr("testString"))) - Expect(listApiKeysOptionsModel.Order).To(Equal(core.StringPtr("asc"))) - Expect(listApiKeysOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) - Expect(listApiKeysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + getServiceIDOptionsModel := iamIdentityService.NewGetServiceIDOptions(id) + getServiceIDOptionsModel.SetID("testString") + getServiceIDOptionsModel.SetIncludeHistory(true) + getServiceIDOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getServiceIDOptionsModel).ToNot(BeNil()) + Expect(getServiceIDOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(getServiceIDOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) + Expect(getServiceIDOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListAPIKeysOptions successfully`, func() { + // Construct an instance of the ListAPIKeysOptions model + listAPIKeysOptionsModel := iamIdentityService.NewListAPIKeysOptions() + listAPIKeysOptionsModel.SetAccountID("testString") + listAPIKeysOptionsModel.SetIamID("testString") + listAPIKeysOptionsModel.SetPagesize(int64(38)) + listAPIKeysOptionsModel.SetPagetoken("testString") + listAPIKeysOptionsModel.SetScope("entity") + listAPIKeysOptionsModel.SetType("user") + listAPIKeysOptionsModel.SetSort("testString") + listAPIKeysOptionsModel.SetOrder("asc") + listAPIKeysOptionsModel.SetIncludeHistory(true) + listAPIKeysOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listAPIKeysOptionsModel).ToNot(BeNil()) + Expect(listAPIKeysOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(listAPIKeysOptionsModel.IamID).To(Equal(core.StringPtr("testString"))) + Expect(listAPIKeysOptionsModel.Pagesize).To(Equal(core.Int64Ptr(int64(38)))) + Expect(listAPIKeysOptionsModel.Pagetoken).To(Equal(core.StringPtr("testString"))) + Expect(listAPIKeysOptionsModel.Scope).To(Equal(core.StringPtr("entity"))) + Expect(listAPIKeysOptionsModel.Type).To(Equal(core.StringPtr("user"))) + Expect(listAPIKeysOptionsModel.Sort).To(Equal(core.StringPtr("testString"))) + Expect(listAPIKeysOptionsModel.Order).To(Equal(core.StringPtr("asc"))) + Expect(listAPIKeysOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) + Expect(listAPIKeysOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewListServiceIdsOptions successfully`, func() { // Construct an instance of the ListServiceIdsOptions model @@ -2403,81 +2431,81 @@ var _ = Describe(`IamIdentityV1`, func() { Expect(listServiceIdsOptionsModel.IncludeHistory).To(Equal(core.BoolPtr(true))) Expect(listServiceIdsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewLockApiKeyOptions successfully`, func() { - // Construct an instance of the LockApiKeyOptions model + It(`Invoke NewLockAPIKeyOptions successfully`, func() { + // Construct an instance of the LockAPIKeyOptions model id := "testString" - lockApiKeyOptionsModel := iamIdentityService.NewLockApiKeyOptions(id) - lockApiKeyOptionsModel.SetID("testString") - lockApiKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(lockApiKeyOptionsModel).ToNot(BeNil()) - Expect(lockApiKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(lockApiKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewLockServiceIdOptions successfully`, func() { - // Construct an instance of the LockServiceIdOptions model + lockAPIKeyOptionsModel := iamIdentityService.NewLockAPIKeyOptions(id) + lockAPIKeyOptionsModel.SetID("testString") + lockAPIKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(lockAPIKeyOptionsModel).ToNot(BeNil()) + Expect(lockAPIKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(lockAPIKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewLockServiceIDOptions successfully`, func() { + // Construct an instance of the LockServiceIDOptions model id := "testString" - lockServiceIdOptionsModel := iamIdentityService.NewLockServiceIdOptions(id) - lockServiceIdOptionsModel.SetID("testString") - lockServiceIdOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(lockServiceIdOptionsModel).ToNot(BeNil()) - Expect(lockServiceIdOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(lockServiceIdOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUnlockApiKeyOptions successfully`, func() { - // Construct an instance of the UnlockApiKeyOptions model + lockServiceIDOptionsModel := iamIdentityService.NewLockServiceIDOptions(id) + lockServiceIDOptionsModel.SetID("testString") + lockServiceIDOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(lockServiceIDOptionsModel).ToNot(BeNil()) + Expect(lockServiceIDOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(lockServiceIDOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewUnlockAPIKeyOptions successfully`, func() { + // Construct an instance of the UnlockAPIKeyOptions model id := "testString" - unlockApiKeyOptionsModel := iamIdentityService.NewUnlockApiKeyOptions(id) - unlockApiKeyOptionsModel.SetID("testString") - unlockApiKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(unlockApiKeyOptionsModel).ToNot(BeNil()) - Expect(unlockApiKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(unlockApiKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUnlockServiceIdOptions successfully`, func() { - // Construct an instance of the UnlockServiceIdOptions model + unlockAPIKeyOptionsModel := iamIdentityService.NewUnlockAPIKeyOptions(id) + unlockAPIKeyOptionsModel.SetID("testString") + unlockAPIKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(unlockAPIKeyOptionsModel).ToNot(BeNil()) + Expect(unlockAPIKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(unlockAPIKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewUnlockServiceIDOptions successfully`, func() { + // Construct an instance of the UnlockServiceIDOptions model id := "testString" - unlockServiceIdOptionsModel := iamIdentityService.NewUnlockServiceIdOptions(id) - unlockServiceIdOptionsModel.SetID("testString") - unlockServiceIdOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(unlockServiceIdOptionsModel).ToNot(BeNil()) - Expect(unlockServiceIdOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(unlockServiceIdOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUpdateApiKeyOptions successfully`, func() { - // Construct an instance of the UpdateApiKeyOptions model + unlockServiceIDOptionsModel := iamIdentityService.NewUnlockServiceIDOptions(id) + unlockServiceIDOptionsModel.SetID("testString") + unlockServiceIDOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(unlockServiceIDOptionsModel).ToNot(BeNil()) + Expect(unlockServiceIDOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(unlockServiceIDOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewUpdateAPIKeyOptions successfully`, func() { + // Construct an instance of the UpdateAPIKeyOptions model id := "testString" ifMatch := "testString" - updateApiKeyOptionsModel := iamIdentityService.NewUpdateApiKeyOptions(id, ifMatch) - updateApiKeyOptionsModel.SetID("testString") - updateApiKeyOptionsModel.SetIfMatch("testString") - updateApiKeyOptionsModel.SetName("testString") - updateApiKeyOptionsModel.SetDescription("testString") - updateApiKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(updateApiKeyOptionsModel).ToNot(BeNil()) - Expect(updateApiKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(updateApiKeyOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) - Expect(updateApiKeyOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(updateApiKeyOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(updateApiKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUpdateServiceIdOptions successfully`, func() { - // Construct an instance of the UpdateServiceIdOptions model + updateAPIKeyOptionsModel := iamIdentityService.NewUpdateAPIKeyOptions(id, ifMatch) + updateAPIKeyOptionsModel.SetID("testString") + updateAPIKeyOptionsModel.SetIfMatch("testString") + updateAPIKeyOptionsModel.SetName("testString") + updateAPIKeyOptionsModel.SetDescription("testString") + updateAPIKeyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateAPIKeyOptionsModel).ToNot(BeNil()) + Expect(updateAPIKeyOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(updateAPIKeyOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) + Expect(updateAPIKeyOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(updateAPIKeyOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(updateAPIKeyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewUpdateServiceIDOptions successfully`, func() { + // Construct an instance of the UpdateServiceIDOptions model id := "testString" ifMatch := "testString" - updateServiceIdOptionsModel := iamIdentityService.NewUpdateServiceIdOptions(id, ifMatch) - updateServiceIdOptionsModel.SetID("testString") - updateServiceIdOptionsModel.SetIfMatch("testString") - updateServiceIdOptionsModel.SetName("testString") - updateServiceIdOptionsModel.SetDescription("testString") - updateServiceIdOptionsModel.SetUniqueInstanceCrns([]string{"testString"}) - updateServiceIdOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(updateServiceIdOptionsModel).ToNot(BeNil()) - Expect(updateServiceIdOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(updateServiceIdOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) - Expect(updateServiceIdOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(updateServiceIdOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(updateServiceIdOptionsModel.UniqueInstanceCrns).To(Equal([]string{"testString"})) - Expect(updateServiceIdOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + updateServiceIDOptionsModel := iamIdentityService.NewUpdateServiceIDOptions(id, ifMatch) + updateServiceIDOptionsModel.SetID("testString") + updateServiceIDOptionsModel.SetIfMatch("testString") + updateServiceIDOptionsModel.SetName("testString") + updateServiceIDOptionsModel.SetDescription("testString") + updateServiceIDOptionsModel.SetUniqueInstanceCrns([]string{"testString"}) + updateServiceIDOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateServiceIDOptionsModel).ToNot(BeNil()) + Expect(updateServiceIDOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(updateServiceIDOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) + Expect(updateServiceIDOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(updateServiceIDOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(updateServiceIDOptionsModel.UniqueInstanceCrns).To(Equal([]string{"testString"})) + Expect(updateServiceIDOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) }) })