From 9f1b19c5d192d70cdfc3c23fd5fc7f0c2e534d27 Mon Sep 17 00:00:00 2001 From: Phil Adams Date: Mon, 8 Mar 2021 09:32:51 -0600 Subject: [PATCH 1/3] fix(IAM Identity): update service after recent API changes --- .../iam_identity/v1/IamIdentityExamples.java | 38 +- .../iam_identity/v1/IamIdentity.java | 82 +++- .../v1/model/AccountSettingsResponse.java | 223 +++++++++++ .../iam_identity/v1/model/ApiKey.java | 2 +- .../ApiKeyInsideCreateServiceIdRequest.java | 2 +- .../iam_identity/v1/model/ApiKeyList.java | 2 +- .../v1/model/CreateApiKeyOptions.java | 2 +- .../v1/model/CreateServiceIdOptions.java | 2 +- .../v1/model/DeleteApiKeyOptions.java | 2 +- .../v1/model/DeleteServiceIdOptions.java | 2 +- .../v1/model/EnityHistoryRecord.java | 2 +- .../v1/model/GetAccountSettingsOptions.java | 122 ++++++ .../v1/model/GetApiKeyOptions.java | 2 +- .../v1/model/GetApiKeysDetailsOptions.java | 2 +- .../v1/model/GetServiceIdOptions.java | 2 +- .../v1/model/ListApiKeysOptions.java | 2 +- .../v1/model/ListServiceIdsOptions.java | 2 +- .../v1/model/LockApiKeyOptions.java | 2 +- .../v1/model/LockServiceIdOptions.java | 2 +- .../v1/model/ResponseContext.java | 2 +- .../iam_identity/v1/model/ServiceId.java | 2 +- .../iam_identity/v1/model/ServiceIdList.java | 2 +- .../v1/model/UnlockApiKeyOptions.java | 2 +- .../v1/model/UnlockServiceIdOptions.java | 2 +- .../model/UpdateAccountSettingsOptions.java | 354 ++++++++++++++++++ .../v1/model/UpdateApiKeyOptions.java | 2 +- .../v1/model/UpdateServiceIdOptions.java | 2 +- .../iam_identity/v1/package-info.java | 2 +- .../iam_identity/v1/IamIdentityIT.java | 57 ++- .../iam_identity/v1/IamIdentityTest.java | 134 ++++++- .../v1/model/AccountSettingsResponseTest.java | 50 +++ ...piKeyInsideCreateServiceIdRequestTest.java | 2 +- .../iam_identity/v1/model/ApiKeyListTest.java | 3 +- .../iam_identity/v1/model/ApiKeyTest.java | 2 +- .../v1/model/CreateApiKeyOptionsTest.java | 2 +- .../v1/model/CreateServiceIdOptionsTest.java | 2 +- .../v1/model/DeleteApiKeyOptionsTest.java | 2 +- .../v1/model/DeleteServiceIdOptionsTest.java | 2 +- .../v1/model/EnityHistoryRecordTest.java | 2 +- .../model/GetAccountSettingsOptionsTest.java | 47 +++ .../v1/model/GetApiKeyOptionsTest.java | 2 +- .../model/GetApiKeysDetailsOptionsTest.java | 2 +- .../v1/model/GetServiceIdOptionsTest.java | 2 +- .../v1/model/ListApiKeysOptionsTest.java | 2 +- .../v1/model/ListServiceIdsOptionsTest.java | 2 +- .../v1/model/LockApiKeyOptionsTest.java | 2 +- .../v1/model/LockServiceIdOptionsTest.java | 2 +- .../v1/model/ResponseContextTest.java | 2 +- .../v1/model/ServiceIdListTest.java | 3 +- .../iam_identity/v1/model/ServiceIdTest.java | 3 +- .../v1/model/UnlockApiKeyOptionsTest.java | 2 +- .../v1/model/UnlockServiceIdOptionsTest.java | 2 +- .../UpdateAccountSettingsOptionsTest.java | 59 +++ .../v1/model/UpdateApiKeyOptionsTest.java | 2 +- .../v1/model/UpdateServiceIdOptionsTest.java | 2 +- .../iam_identity/v1/utils/TestUtilities.java | 2 +- 56 files changed, 1200 insertions(+), 61 deletions(-) create mode 100644 modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponse.java create mode 100644 modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptions.java create mode 100644 modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptions.java create mode 100644 modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponseTest.java create mode 100644 modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptionsTest.java create mode 100644 modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptionsTest.java diff --git a/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java b/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java index 57315e6421..72a950918e 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,12 +18,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsResponse; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKey; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKeyList; import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateServiceIdOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.GetAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeysDetailsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetServiceIdOptions; @@ -35,6 +37,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdList; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateServiceIdOptions; import com.ibm.cloud.sdk.core.http.Response; @@ -319,5 +322,38 @@ public static void main(String[] args) throws Exception { logger.error(String.format("Service returned status code %s: %s\nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } + + try { + // begin-getAccountSettings + GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder() + .accountId("testString") + .build(); + + Response response = service.getAccountSettings(getAccountSettingsOptions).execute(); + AccountSettingsResponse accountSettingsResponse = response.getResult(); + + System.out.println(accountSettingsResponse); + // end-getAccountSettings + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + // begin-updateAccountSettings + UpdateAccountSettingsOptions updateAccountSettingsOptions = new UpdateAccountSettingsOptions.Builder() + .ifMatch("testString") + .accountId("testString") + .build(); + + Response response = service.updateAccountSettings(updateAccountSettingsOptions).execute(); + AccountSettingsResponse accountSettingsResponse = response.getResult(); + + System.out.println(accountSettingsResponse); + // end-updateAccountSettings + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } } } diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentity.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentity.java index c3f68cc973..5cee03c64b 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentity.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentity.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,19 +12,21 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-d753183b-20201209-163011 + * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-e6cfc86e-20210308-084627 */ package com.ibm.cloud.platform_services.iam_identity.v1; import com.google.gson.JsonObject; import com.ibm.cloud.platform_services.common.SdkCommon; +import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsResponse; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKey; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKeyList; import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateServiceIdOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.GetAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeysDetailsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetServiceIdOptions; @@ -36,6 +38,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdList; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateServiceIdOptions; import com.ibm.cloud.sdk.core.http.RequestBuilder; @@ -50,7 +53,7 @@ import java.util.Map.Entry; /** - * The IAM Identity Service API allows for the management of Identities (Service IDs, ApiKeys). + * The IAM Identity Service API allows for the management of Account Settings and Identities (Service IDs, ApiKeys). * * @version v1 */ @@ -622,4 +625,77 @@ public ServiceCall unlockServiceId(UnlockServiceIdOptions unlockServiceIdO return createServiceCall(builder.build(), responseConverter); } + /** + * Get account configurations. + * + * Returns the details of an account's configuration. + * + * @param getAccountSettingsOptions the {@link GetAccountSettingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AccountSettingsResponse} + */ + public ServiceCall getAccountSettings(GetAccountSettingsOptions getAccountSettingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getAccountSettingsOptions, + "getAccountSettingsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("account_id", getAccountSettingsOptions.accountId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/accounts/{account_id}/settings/identity", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getAccountSettings"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getAccountSettingsOptions.includeHistory() != null) { + builder.query("include_history", String.valueOf(getAccountSettingsOptions.includeHistory())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update account configurations. + * + * Allows a user to configure settings on their account with regards to MFA, session lifetimes, access control for + * creating new identities, and enforcing IP restrictions on token creation. + * + * @param updateAccountSettingsOptions the {@link UpdateAccountSettingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AccountSettingsResponse} + */ + public ServiceCall updateAccountSettings(UpdateAccountSettingsOptions updateAccountSettingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateAccountSettingsOptions, + "updateAccountSettingsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("account_id", updateAccountSettingsOptions.accountId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/accounts/{account_id}/settings/identity", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updateAccountSettings"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.header("If-Match", updateAccountSettingsOptions.ifMatch()); + final JsonObject contentJson = new JsonObject(); + if (updateAccountSettingsOptions.restrictCreateServiceId() != null) { + contentJson.addProperty("restrict_create_service_id", updateAccountSettingsOptions.restrictCreateServiceId()); + } + if (updateAccountSettingsOptions.restrictCreatePlatformApikey() != null) { + contentJson.addProperty("restrict_create_platform_apikey", updateAccountSettingsOptions.restrictCreatePlatformApikey()); + } + if (updateAccountSettingsOptions.allowedIpAddresses() != null) { + contentJson.addProperty("allowed_ip_addresses", updateAccountSettingsOptions.allowedIpAddresses()); + } + if (updateAccountSettingsOptions.mfa() != null) { + contentJson.addProperty("mfa", updateAccountSettingsOptions.mfa()); + } + if (updateAccountSettingsOptions.sessionExpirationInSeconds() != null) { + contentJson.addProperty("session_expiration_in_seconds", updateAccountSettingsOptions.sessionExpirationInSeconds()); + } + if (updateAccountSettingsOptions.sessionInvalidationInSeconds() != null) { + contentJson.addProperty("session_invalidation_in_seconds", updateAccountSettingsOptions.sessionInvalidationInSeconds()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + } diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponse.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponse.java new file mode 100644 index 0000000000..02887c93aa --- /dev/null +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponse.java @@ -0,0 +1,223 @@ +/* + * (C) Copyright IBM Corp. 2021. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.platform_services.iam_identity.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Response body format for Account Settings REST requests. + */ +public class AccountSettingsResponse extends GenericModel { + + /** + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to 'unset' a previous set value. + */ + public interface RestrictCreateServiceId { + /** RESTRICTED. */ + String RESTRICTED = "RESTRICTED"; + /** NOT_RESTRICTED. */ + String NOT_RESTRICTED = "NOT_RESTRICTED"; + /** NOT_SET. */ + String NOT_SET = "NOT_SET"; + } + + /** + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to 'unset' a previous set value. + */ + public interface RestrictCreatePlatformApikey { + /** RESTRICTED. */ + String RESTRICTED = "RESTRICTED"; + /** NOT_RESTRICTED. */ + String NOT_RESTRICTED = "NOT_RESTRICTED"; + /** NOT_SET. */ + String NOT_SET = "NOT_SET"; + } + + /** + * Defines the MFA trait for the account. Valid values: + * * NONE - No MFA trait set + * * TOTP - For all non-federated IBMId users + * * TOTP4ALL - For all users + * * LEVEL1 - Email-based MFA for all users + * * LEVEL2 - TOTP-based MFA for all users + * * LEVEL3 - U2F MFA for all users. + */ + public interface Mfa { + /** NONE. */ + String NONE = "NONE"; + /** TOTP. */ + String TOTP = "TOTP"; + /** TOTP4ALL. */ + String TOTP4ALL = "TOTP4ALL"; + /** LEVEL1. */ + String LEVEL1 = "LEVEL1"; + /** LEVEL2. */ + String LEVEL2 = "LEVEL2"; + /** LEVEL3. */ + String LEVEL3 = "LEVEL3"; + } + + protected ResponseContext context; + @SerializedName("account_id") + protected String accountId; + @SerializedName("restrict_create_service_id") + protected String restrictCreateServiceId; + @SerializedName("restrict_create_platform_apikey") + protected String restrictCreatePlatformApikey; + @SerializedName("allowed_ip_addresses") + protected String allowedIpAddresses; + @SerializedName("entity_tag") + protected String entityTag; + protected String mfa; + protected List history; + @SerializedName("session_expiration_in_seconds") + protected String sessionExpirationInSeconds; + @SerializedName("session_invalidation_in_seconds") + protected String sessionInvalidationInSeconds; + + /** + * Gets the context. + * + * Context with key properties for problem determination. + * + * @return the context + */ + public ResponseContext getContext() { + return context; + } + + /** + * Gets the accountId. + * + * Unique ID of the account. + * + * @return the accountId + */ + public String getAccountId() { + return accountId; + } + + /** + * Gets the restrictCreateServiceId. + * + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to 'unset' a previous set value. + * + * @return the restrictCreateServiceId + */ + public String getRestrictCreateServiceId() { + return restrictCreateServiceId; + } + + /** + * Gets the restrictCreatePlatformApikey. + * + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to 'unset' a previous set value. + * + * @return the restrictCreatePlatformApikey + */ + public String getRestrictCreatePlatformApikey() { + return restrictCreatePlatformApikey; + } + + /** + * Gets the allowedIpAddresses. + * + * Defines the IP addresses and subnets from which IAM tokens can be created for the account. + * + * @return the allowedIpAddresses + */ + public String getAllowedIpAddresses() { + return allowedIpAddresses; + } + + /** + * Gets the entityTag. + * + * Version of the account settings. + * + * @return the entityTag + */ + public String getEntityTag() { + return entityTag; + } + + /** + * Gets the mfa. + * + * Defines the MFA trait for the account. Valid values: + * * NONE - No MFA trait set + * * TOTP - For all non-federated IBMId users + * * TOTP4ALL - For all users + * * LEVEL1 - Email-based MFA for all users + * * LEVEL2 - TOTP-based MFA for all users + * * LEVEL3 - U2F MFA for all users. + * + * @return the mfa + */ + public String getMfa() { + return mfa; + } + + /** + * Gets the history. + * + * History of the Account Settings. + * + * @return the history + */ + public List getHistory() { + return history; + } + + /** + * Gets the sessionExpirationInSeconds. + * + * Defines the session expiration in seconds for the account. Valid values: + * * Any whole number between between '900' and '86400' + * * NOT_SET - To unset account setting and use service default. + * + * @return the sessionExpirationInSeconds + */ + public String getSessionExpirationInSeconds() { + return sessionExpirationInSeconds; + } + + /** + * Gets the sessionInvalidationInSeconds. + * + * Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: + * * Any whole number between '900' and '7200' + * * NOT_SET - To unset account setting and use service default. + * + * @return the sessionInvalidationInSeconds + */ + public String getSessionInvalidationInSeconds() { + return sessionInvalidationInSeconds; + } +} + diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKey.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKey.java index 54fd608d8c..5c3e9b69f7 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKey.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKey.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequest.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequest.java index eda011f3d0..82b0030ac4 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequest.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyList.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyList.java index 5bbe1c6bba..443caa7895 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyList.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyList.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptions.java index 865a474a50..1e044cf256 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptions.java index e8cc980456..78cd21687f 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptions.java index f3981f8ff1..d665cba2b3 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptions.java index 6f98f179a1..31b28bde6a 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecord.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecord.java index 8b35e5a121..0b02a97f99 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecord.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecord.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptions.java new file mode 100644 index 0000000000..a40ff73bd0 --- /dev/null +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptions.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2021. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.platform_services.iam_identity.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getAccountSettings options. + */ +public class GetAccountSettingsOptions extends GenericModel { + + protected String accountId; + protected Boolean includeHistory; + + /** + * Builder. + */ + public static class Builder { + private String accountId; + private Boolean includeHistory; + + private Builder(GetAccountSettingsOptions getAccountSettingsOptions) { + this.accountId = getAccountSettingsOptions.accountId; + this.includeHistory = getAccountSettingsOptions.includeHistory; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param accountId the accountId + */ + public Builder(String accountId) { + this.accountId = accountId; + } + + /** + * Builds a GetAccountSettingsOptions. + * + * @return the new GetAccountSettingsOptions instance + */ + public GetAccountSettingsOptions build() { + return new GetAccountSettingsOptions(this); + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the GetAccountSettingsOptions builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the includeHistory. + * + * @param includeHistory the includeHistory + * @return the GetAccountSettingsOptions builder + */ + public Builder includeHistory(Boolean includeHistory) { + this.includeHistory = includeHistory; + return this; + } + } + + protected GetAccountSettingsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.accountId, + "accountId cannot be empty"); + accountId = builder.accountId; + includeHistory = builder.includeHistory; + } + + /** + * New builder. + * + * @return a GetAccountSettingsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the accountId. + * + * Unique ID of the account. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the includeHistory. + * + * Defines if the entity history is included in the response. + * + * @return the includeHistory + */ + public Boolean includeHistory() { + return includeHistory; + } +} + diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptions.java index 11437aae5a..6094477526 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptions.java index 46693182ab..c98ce7c06e 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptions.java index f82bf7ae60..6d4009bfad 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptions.java index 7f42516fcf..d034d5bed6 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptions.java index ea7bd4a961..2eb53f69d4 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptions.java index 4843da2c89..c069d378eb 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptions.java index b56d8171d9..de3e08d66b 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContext.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContext.java index 87ddc57e40..3b8102b0e1 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContext.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContext.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceId.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceId.java index 8ff20a2d2e..addf8a8b44 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceId.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceId.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdList.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdList.java index f009c55621..2dfd6e00d1 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdList.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdList.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptions.java index b8eff53004..edef5a32a1 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptions.java index 7832f35d55..19f98d29a1 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptions.java new file mode 100644 index 0000000000..1b959f7c62 --- /dev/null +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptions.java @@ -0,0 +1,354 @@ +/* + * (C) Copyright IBM Corp. 2021. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.cloud.platform_services.iam_identity.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The updateAccountSettings options. + */ +public class UpdateAccountSettingsOptions extends GenericModel { + + /** + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to unset a previously set value. + */ + public interface RestrictCreateServiceId { + /** RESTRICTED. */ + String RESTRICTED = "RESTRICTED"; + /** NOT_RESTRICTED. */ + String NOT_RESTRICTED = "NOT_RESTRICTED"; + /** NOT_SET. */ + String NOT_SET = "NOT_SET"; + } + + /** + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to 'unset' a previous set value. + */ + public interface RestrictCreatePlatformApikey { + /** RESTRICTED. */ + String RESTRICTED = "RESTRICTED"; + /** NOT_RESTRICTED. */ + String NOT_RESTRICTED = "NOT_RESTRICTED"; + /** NOT_SET. */ + String NOT_SET = "NOT_SET"; + } + + /** + * Defines the MFA trait for the account. Valid values: + * * NONE - No MFA trait set + * * TOTP - For all non-federated IBMId users + * * TOTP4ALL - For all users + * * LEVEL1 - Email-based MFA for all users + * * LEVEL2 - TOTP-based MFA for all users + * * LEVEL3 - U2F MFA for all users. + */ + public interface Mfa { + /** NONE. */ + String NONE = "NONE"; + /** TOTP. */ + String TOTP = "TOTP"; + /** TOTP4ALL. */ + String TOTP4ALL = "TOTP4ALL"; + /** LEVEL1. */ + String LEVEL1 = "LEVEL1"; + /** LEVEL2. */ + String LEVEL2 = "LEVEL2"; + /** LEVEL3. */ + String LEVEL3 = "LEVEL3"; + } + + protected String ifMatch; + protected String accountId; + protected String restrictCreateServiceId; + protected String restrictCreatePlatformApikey; + protected String allowedIpAddresses; + protected String mfa; + protected String sessionExpirationInSeconds; + protected String sessionInvalidationInSeconds; + + /** + * Builder. + */ + public static class Builder { + private String ifMatch; + private String accountId; + private String restrictCreateServiceId; + private String restrictCreatePlatformApikey; + private String allowedIpAddresses; + private String mfa; + private String sessionExpirationInSeconds; + private String sessionInvalidationInSeconds; + + private Builder(UpdateAccountSettingsOptions updateAccountSettingsOptions) { + this.ifMatch = updateAccountSettingsOptions.ifMatch; + this.accountId = updateAccountSettingsOptions.accountId; + this.restrictCreateServiceId = updateAccountSettingsOptions.restrictCreateServiceId; + this.restrictCreatePlatformApikey = updateAccountSettingsOptions.restrictCreatePlatformApikey; + this.allowedIpAddresses = updateAccountSettingsOptions.allowedIpAddresses; + this.mfa = updateAccountSettingsOptions.mfa; + this.sessionExpirationInSeconds = updateAccountSettingsOptions.sessionExpirationInSeconds; + this.sessionInvalidationInSeconds = updateAccountSettingsOptions.sessionInvalidationInSeconds; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param ifMatch the ifMatch + * @param accountId the accountId + */ + public Builder(String ifMatch, String accountId) { + this.ifMatch = ifMatch; + this.accountId = accountId; + } + + /** + * Builds a UpdateAccountSettingsOptions. + * + * @return the new UpdateAccountSettingsOptions instance + */ + public UpdateAccountSettingsOptions build() { + return new UpdateAccountSettingsOptions(this); + } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the UpdateAccountSettingsOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the UpdateAccountSettingsOptions builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the restrictCreateServiceId. + * + * @param restrictCreateServiceId the restrictCreateServiceId + * @return the UpdateAccountSettingsOptions builder + */ + public Builder restrictCreateServiceId(String restrictCreateServiceId) { + this.restrictCreateServiceId = restrictCreateServiceId; + return this; + } + + /** + * Set the restrictCreatePlatformApikey. + * + * @param restrictCreatePlatformApikey the restrictCreatePlatformApikey + * @return the UpdateAccountSettingsOptions builder + */ + public Builder restrictCreatePlatformApikey(String restrictCreatePlatformApikey) { + this.restrictCreatePlatformApikey = restrictCreatePlatformApikey; + return this; + } + + /** + * Set the allowedIpAddresses. + * + * @param allowedIpAddresses the allowedIpAddresses + * @return the UpdateAccountSettingsOptions builder + */ + public Builder allowedIpAddresses(String allowedIpAddresses) { + this.allowedIpAddresses = allowedIpAddresses; + return this; + } + + /** + * Set the mfa. + * + * @param mfa the mfa + * @return the UpdateAccountSettingsOptions builder + */ + public Builder mfa(String mfa) { + this.mfa = mfa; + return this; + } + + /** + * Set the sessionExpirationInSeconds. + * + * @param sessionExpirationInSeconds the sessionExpirationInSeconds + * @return the UpdateAccountSettingsOptions builder + */ + public Builder sessionExpirationInSeconds(String sessionExpirationInSeconds) { + this.sessionExpirationInSeconds = sessionExpirationInSeconds; + return this; + } + + /** + * Set the sessionInvalidationInSeconds. + * + * @param sessionInvalidationInSeconds the sessionInvalidationInSeconds + * @return the UpdateAccountSettingsOptions builder + */ + public Builder sessionInvalidationInSeconds(String sessionInvalidationInSeconds) { + this.sessionInvalidationInSeconds = sessionInvalidationInSeconds; + return this; + } + } + + protected UpdateAccountSettingsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.ifMatch, + "ifMatch cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.accountId, + "accountId cannot be empty"); + ifMatch = builder.ifMatch; + accountId = builder.accountId; + restrictCreateServiceId = builder.restrictCreateServiceId; + restrictCreatePlatformApikey = builder.restrictCreatePlatformApikey; + allowedIpAddresses = builder.allowedIpAddresses; + mfa = builder.mfa; + sessionExpirationInSeconds = builder.sessionExpirationInSeconds; + sessionInvalidationInSeconds = builder.sessionInvalidationInSeconds; + } + + /** + * New builder. + * + * @return a UpdateAccountSettingsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the ifMatch. + * + * Version of the account settings to be updated. Specify the version that you retrieved as entity_tag (ETag header) + * when reading the account. This value helps identifying parallel usage of this API. Pass * to indicate to update + * any version available. This might result in stale updates. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } + + /** + * Gets the accountId. + * + * The id of the account to update the settings for. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the restrictCreateServiceId. + * + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to unset a previously set value. + * + * @return the restrictCreateServiceId + */ + public String restrictCreateServiceId() { + return restrictCreateServiceId; + } + + /** + * Gets the restrictCreatePlatformApikey. + * + * Defines whether or not creating a Service Id is access controlled. Valid values: + * * RESTRICTED - to apply access control + * * NOT_RESTRICTED - to remove access control + * * NOT_SET - to 'unset' a previous set value. + * + * @return the restrictCreatePlatformApikey + */ + public String restrictCreatePlatformApikey() { + return restrictCreatePlatformApikey; + } + + /** + * Gets the allowedIpAddresses. + * + * Defines the IP addresses and subnets from which IAM tokens can be created for the account. + * + * @return the allowedIpAddresses + */ + public String allowedIpAddresses() { + return allowedIpAddresses; + } + + /** + * Gets the mfa. + * + * Defines the MFA trait for the account. Valid values: + * * NONE - No MFA trait set + * * TOTP - For all non-federated IBMId users + * * TOTP4ALL - For all users + * * LEVEL1 - Email-based MFA for all users + * * LEVEL2 - TOTP-based MFA for all users + * * LEVEL3 - U2F MFA for all users. + * + * @return the mfa + */ + public String mfa() { + return mfa; + } + + /** + * Gets the sessionExpirationInSeconds. + * + * Defines the session expiration in seconds for the account. Valid values: + * * Any whole number between between '900' and '86400' + * * NOT_SET - To unset account setting and use service default. + * + * @return the sessionExpirationInSeconds + */ + public String sessionExpirationInSeconds() { + return sessionExpirationInSeconds; + } + + /** + * Gets the sessionInvalidationInSeconds. + * + * Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: + * * Any whole number between '900' and '7200' + * * NOT_SET - To unset account setting and use service default. + * + * @return the sessionInvalidationInSeconds + */ + public String sessionInvalidationInSeconds() { + return sessionInvalidationInSeconds; + } +} + diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptions.java index 1f5672b2fa..45b8b85247 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptions.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptions.java index 4e183ac32d..dacac92b52 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptions.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/package-info.java b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/package-info.java index 39fcbafd71..12d5cb0af1 100644 --- a/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/package-info.java +++ b/modules/iam-identity/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java index 2489f0a27e..6efbe5eefd 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -29,12 +29,14 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsResponse; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKey; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKeyList; import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateServiceIdOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.GetAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeysDetailsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetServiceIdOptions; @@ -46,6 +48,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdList; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateServiceIdOptions; import com.ibm.cloud.platform_services.test.SdkIntegrationTestBase; @@ -662,6 +665,58 @@ public void testGetServiceIdNegative() throws Exception { } } + @Test + public void testGetAccountSettings() throws Exception { + try { + GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder() + .accountId("testString") + .includeHistory(true) + .build(); + + // Invoke operation + Response response = service.getAccountSettings(getAccountSettingsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AccountSettingsResponse accountSettingsResponseResult = response.getResult(); + + assertNotNull(accountSettingsResponseResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test + public void testUpdateAccountSettings() throws Exception { + try { + UpdateAccountSettingsOptions updateAccountSettingsOptions = new UpdateAccountSettingsOptions.Builder() + .ifMatch("testString") + .accountId("testString") + .restrictCreateServiceId("RESTRICTED") + .restrictCreatePlatformApikey("RESTRICTED") + .allowedIpAddresses("testString") + .mfa("NONE") + .sessionExpirationInSeconds("testString") + .sessionInvalidationInSeconds("testString") + .build(); + + // Invoke operation + Response response = service.updateAccountSettings(updateAccountSettingsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AccountSettingsResponse accountSettingsResponseResult = response.getResult(); + + assertNotNull(accountSettingsResponseResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + @AfterClass public void tearDown() { // Add any clean up logic here. diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityTest.java index 0f4d3eb886..bc81e9826c 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,6 +13,7 @@ package com.ibm.cloud.platform_services.iam_identity.v1; import com.ibm.cloud.platform_services.iam_identity.v1.IamIdentity; +import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsResponse; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKey; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKeyInsideCreateServiceIdRequest; import com.ibm.cloud.platform_services.iam_identity.v1.model.ApiKeyList; @@ -21,6 +22,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteServiceIdOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.EnityHistoryRecord; +import com.ibm.cloud.platform_services.iam_identity.v1.model.GetAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetApiKeysDetailsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.GetServiceIdOptions; @@ -33,6 +35,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdList; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UnlockServiceIdOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateAccountSettingsOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateApiKeyOptions; import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateServiceIdOptions; import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; @@ -40,6 +43,7 @@ import com.ibm.cloud.sdk.core.security.Authenticator; import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; import com.ibm.cloud.sdk.core.util.EnvironmentUtils; import java.io.IOException; import java.io.InputStream; @@ -103,7 +107,7 @@ public void testConstructorWithNullAuthenticator() throws Throwable { @Test public void testListApiKeysWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}]}"; + String mockResponseBody = "{\"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}]}"; String listApiKeysPath = "/v1/apikeys"; server.enqueue(new MockResponse() @@ -158,7 +162,7 @@ public void testListApiKeysWOptions() throws Throwable { @Test public void testCreateApiKeyWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}"; + String mockResponseBody = "{\"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}"; String createApiKeyPath = "/v1/apikeys"; server.enqueue(new MockResponse() @@ -214,7 +218,7 @@ public void testCreateApiKeyNoOptions() throws Throwable { @Test public void testGetApiKeysDetailsWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}"; + String mockResponseBody = "{\"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}"; String getApiKeysDetailsPath = "/v1/apikeys/details"; server.enqueue(new MockResponse() @@ -254,7 +258,7 @@ public void testGetApiKeysDetailsWOptions() throws Throwable { @Test public void testGetApiKeyWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}"; + String mockResponseBody = "{\"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}"; String getApiKeyPath = "/v1/apikeys/testString"; server.enqueue(new MockResponse() @@ -306,7 +310,7 @@ public void testGetApiKeyNoOptions() throws Throwable { @Test public void testUpdateApiKeyWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}"; + String mockResponseBody = "{\"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}"; String updateApiKeyPath = "/v1/apikeys/testString"; server.enqueue(new MockResponse() @@ -510,7 +514,7 @@ public void testUnlockApiKeyNoOptions() throws Throwable { @Test public void testListServiceIdsWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}}]}"; + String mockResponseBody = "{\"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.000Z\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}}]}"; String listServiceIdsPath = "/v1/serviceids/"; server.enqueue(new MockResponse() @@ -561,7 +565,7 @@ public void testListServiceIdsWOptions() throws Throwable { @Test public void testCreateServiceIdWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}}"; + String mockResponseBody = "{\"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.000Z\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}}"; String createServiceIdPath = "/v1/serviceids/"; server.enqueue(new MockResponse() @@ -624,7 +628,7 @@ public void testCreateServiceIdNoOptions() throws Throwable { @Test public void testGetServiceIdWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}}"; + String mockResponseBody = "{\"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.000Z\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}}"; String getServiceIdPath = "/v1/serviceids/testString"; server.enqueue(new MockResponse() @@ -676,7 +680,7 @@ public void testGetServiceIdNoOptions() throws Throwable { @Test public void testUpdateServiceIdWOptions() throws Throwable { // Schedule some responses. - String mockResponseBody = "{\"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\"}]}}"; + String mockResponseBody = "{\"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.000Z\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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.000Z\", \"created_by\": \"createdBy\", \"modified_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}]}}"; String updateServiceIdPath = "/v1/serviceids/testString"; server.enqueue(new MockResponse() @@ -878,6 +882,116 @@ public void testUnlockServiceIdNoOptions() throws Throwable { iamIdentityService.unlockServiceId(null).execute(); } + @Test + public void testGetAccountSettingsWOptions() throws Throwable { + // Schedule some responses. + String mockResponseBody = "{\"context\": {\"transaction_id\": \"transactionId\", \"operation\": \"operation\", \"user_agent\": \"userAgent\", \"url\": \"url\", \"instance_id\": \"instanceId\", \"thread_id\": \"threadId\", \"host\": \"host\", \"start_time\": \"startTime\", \"end_time\": \"endTime\", \"elapsed_time\": \"elapsedTime\", \"cluster_name\": \"clusterName\"}, \"account_id\": \"accountId\", \"restrict_create_service_id\": \"RESTRICTED\", \"restrict_create_platform_apikey\": \"RESTRICTED\", \"allowed_ip_addresses\": \"allowedIpAddresses\", \"entity_tag\": \"entityTag\", \"mfa\": \"NONE\", \"history\": [{\"timestamp\": \"timestamp\", \"iam_id\": \"iamId\", \"iam_id_account\": \"iamIdAccount\", \"action\": \"action\", \"params\": [\"params\"], \"message\": \"message\"}], \"session_expiration_in_seconds\": \"sessionExpirationInSeconds\", \"session_invalidation_in_seconds\": \"sessionInvalidationInSeconds\"}"; + String getAccountSettingsPath = "/v1/accounts/testString/settings/identity"; + + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + constructClientService(); + + // Construct an instance of the GetAccountSettingsOptions model + GetAccountSettingsOptions getAccountSettingsOptionsModel = new GetAccountSettingsOptions.Builder() + .accountId("testString") + .includeHistory(true) + .build(); + + // Invoke operation with valid options model (positive test) + Response response = iamIdentityService.getAccountSettings(getAccountSettingsOptionsModel).execute(); + assertNotNull(response); + AccountSettingsResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + + // Check query + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + // Get query params + assertEquals(Boolean.valueOf(query.get("include_history")), Boolean.valueOf(true)); + // Check request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getAccountSettingsPath); + } + + // Test the getAccountSettings operation with null options model parameter + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetAccountSettingsNoOptions() throws Throwable { + // construct the service + constructClientService(); + + server.enqueue(new MockResponse()); + + // Invoke operation with null options model (negative test) + iamIdentityService.getAccountSettings(null).execute(); + } + + @Test + public void testUpdateAccountSettingsWOptions() throws Throwable { + // Schedule some responses. + String mockResponseBody = "{\"context\": {\"transaction_id\": \"transactionId\", \"operation\": \"operation\", \"user_agent\": \"userAgent\", \"url\": \"url\", \"instance_id\": \"instanceId\", \"thread_id\": \"threadId\", \"host\": \"host\", \"start_time\": \"startTime\", \"end_time\": \"endTime\", \"elapsed_time\": \"elapsedTime\", \"cluster_name\": \"clusterName\"}, \"account_id\": \"accountId\", \"restrict_create_service_id\": \"RESTRICTED\", \"restrict_create_platform_apikey\": \"RESTRICTED\", \"allowed_ip_addresses\": \"allowedIpAddresses\", \"entity_tag\": \"entityTag\", \"mfa\": \"NONE\", \"history\": [{\"timestamp\": \"timestamp\", \"iam_id\": \"iamId\", \"iam_id_account\": \"iamIdAccount\", \"action\": \"action\", \"params\": [\"params\"], \"message\": \"message\"}], \"session_expiration_in_seconds\": \"sessionExpirationInSeconds\", \"session_invalidation_in_seconds\": \"sessionInvalidationInSeconds\"}"; + String updateAccountSettingsPath = "/v1/accounts/testString/settings/identity"; + + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + constructClientService(); + + // Construct an instance of the UpdateAccountSettingsOptions model + UpdateAccountSettingsOptions updateAccountSettingsOptionsModel = new UpdateAccountSettingsOptions.Builder() + .ifMatch("testString") + .accountId("testString") + .restrictCreateServiceId("RESTRICTED") + .restrictCreatePlatformApikey("RESTRICTED") + .allowedIpAddresses("testString") + .mfa("NONE") + .sessionExpirationInSeconds("testString") + .sessionInvalidationInSeconds("testString") + .build(); + + // Invoke operation with valid options model (positive test) + Response response = iamIdentityService.updateAccountSettings(updateAccountSettingsOptionsModel).execute(); + assertNotNull(response); + AccountSettingsResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getHeader("If-Match"), "testString"); + + // Check query + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + + // Check request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateAccountSettingsPath); + } + + // Test the updateAccountSettings operation with null options model parameter + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateAccountSettingsNoOptions() throws Throwable { + // construct the service + constructClientService(); + + server.enqueue(new MockResponse()); + + // Invoke operation with null options model (negative test) + iamIdentityService.updateAccountSettings(null).execute(); + } + /** Initialize the server */ @BeforeMethod public void setUpMockServer() { diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponseTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponseTest.java new file mode 100644 index 0000000000..d8e10ffc9d --- /dev/null +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/AccountSettingsResponseTest.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2021. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.iam_identity.v1.model; + +import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsResponse; +import com.ibm.cloud.platform_services.iam_identity.v1.model.EnityHistoryRecord; +import com.ibm.cloud.platform_services.iam_identity.v1.model.ResponseContext; +import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AccountSettingsResponse model. + */ +public class AccountSettingsResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAccountSettingsResponse() throws Throwable { + AccountSettingsResponse accountSettingsResponseModel = new AccountSettingsResponse(); + assertNull(accountSettingsResponseModel.getContext()); + assertNull(accountSettingsResponseModel.getAccountId()); + assertNull(accountSettingsResponseModel.getRestrictCreateServiceId()); + assertNull(accountSettingsResponseModel.getRestrictCreatePlatformApikey()); + assertNull(accountSettingsResponseModel.getAllowedIpAddresses()); + assertNull(accountSettingsResponseModel.getEntityTag()); + assertNull(accountSettingsResponseModel.getMfa()); + assertNull(accountSettingsResponseModel.getHistory()); + assertNull(accountSettingsResponseModel.getSessionExpirationInSeconds()); + assertNull(accountSettingsResponseModel.getSessionInvalidationInSeconds()); + } +} \ No newline at end of file diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequestTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequestTest.java index aaae68bd55..49d9736f70 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequestTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyInsideCreateServiceIdRequestTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyListTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyListTest.java index 306e863d26..c204e98b5a 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyListTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyListTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,6 +19,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ResponseContext; import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyTest.java index d92a4761f9..eebf8e17cd 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ApiKeyTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptionsTest.java index 4272e360c0..f55892b461 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateApiKeyOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptionsTest.java index 8e8ccf848f..15a2dfef86 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/CreateServiceIdOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptionsTest.java index 5f59c8e441..c55a03d194 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteApiKeyOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptionsTest.java index 0a59cb278f..74ebc00fd2 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/DeleteServiceIdOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecordTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecordTest.java index d4f94f9751..1cacf73fd1 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecordTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/EnityHistoryRecordTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptionsTest.java new file mode 100644 index 0000000000..367b930cbc --- /dev/null +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetAccountSettingsOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2021. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.iam_identity.v1.model; + +import com.ibm.cloud.platform_services.iam_identity.v1.model.GetAccountSettingsOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetAccountSettingsOptions model. + */ +public class GetAccountSettingsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetAccountSettingsOptions() throws Throwable { + GetAccountSettingsOptions getAccountSettingsOptionsModel = new GetAccountSettingsOptions.Builder() + .accountId("testString") + .includeHistory(true) + .build(); + assertEquals(getAccountSettingsOptionsModel.accountId(), "testString"); + assertEquals(getAccountSettingsOptionsModel.includeHistory(), Boolean.valueOf(true)); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetAccountSettingsOptionsError() throws Throwable { + new GetAccountSettingsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptionsTest.java index f0b6d12282..58ba7e77ac 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeyOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptionsTest.java index 2f81a0a9fb..33f1849208 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetApiKeysDetailsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptionsTest.java index 85b4bec889..261e8b1c53 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/GetServiceIdOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptionsTest.java index 6d64f67fdb..c5d6039efd 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListApiKeysOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptionsTest.java index 1df8a88272..0c703439fa 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ListServiceIdsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptionsTest.java index 22ee969dc5..82aa50507b 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockApiKeyOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptionsTest.java index ba0025786c..374fe61701 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/LockServiceIdOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContextTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContextTest.java index 1b6c384415..a1fc1f7c0d 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContextTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ResponseContextTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdListTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdListTest.java index 9ecd656532..b82deee7c8 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdListTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdListTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -20,6 +20,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdList; import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdTest.java index 101fe41536..ae3203e39a 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/ServiceIdTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,6 +19,7 @@ import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceId; import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptionsTest.java index 9d4301a85e..cd9efdba5f 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockApiKeyOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptionsTest.java index 2421fce29b..8335f07e03 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UnlockServiceIdOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptionsTest.java new file mode 100644 index 0000000000..9fad1a54b5 --- /dev/null +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateAccountSettingsOptionsTest.java @@ -0,0 +1,59 @@ +/* + * (C) Copyright IBM Corp. 2021. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.iam_identity.v1.model; + +import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateAccountSettingsOptions; +import com.ibm.cloud.platform_services.iam_identity.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UpdateAccountSettingsOptions model. + */ +public class UpdateAccountSettingsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateAccountSettingsOptions() throws Throwable { + UpdateAccountSettingsOptions updateAccountSettingsOptionsModel = new UpdateAccountSettingsOptions.Builder() + .ifMatch("testString") + .accountId("testString") + .restrictCreateServiceId("RESTRICTED") + .restrictCreatePlatformApikey("RESTRICTED") + .allowedIpAddresses("testString") + .mfa("NONE") + .sessionExpirationInSeconds("testString") + .sessionInvalidationInSeconds("testString") + .build(); + assertEquals(updateAccountSettingsOptionsModel.ifMatch(), "testString"); + assertEquals(updateAccountSettingsOptionsModel.accountId(), "testString"); + assertEquals(updateAccountSettingsOptionsModel.restrictCreateServiceId(), "RESTRICTED"); + assertEquals(updateAccountSettingsOptionsModel.restrictCreatePlatformApikey(), "RESTRICTED"); + assertEquals(updateAccountSettingsOptionsModel.allowedIpAddresses(), "testString"); + assertEquals(updateAccountSettingsOptionsModel.mfa(), "NONE"); + assertEquals(updateAccountSettingsOptionsModel.sessionExpirationInSeconds(), "testString"); + assertEquals(updateAccountSettingsOptionsModel.sessionInvalidationInSeconds(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateAccountSettingsOptionsError() throws Throwable { + new UpdateAccountSettingsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptionsTest.java index 431429cf3a..1db5293b1f 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateApiKeyOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptionsTest.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptionsTest.java index ea8ded55e9..90996d86dd 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptionsTest.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/model/UpdateServiceIdOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/utils/TestUtilities.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/utils/TestUtilities.java index b86764aa47..a79d279618 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/utils/TestUtilities.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at From 1d3296583a1c94f0963dc3924321b7bef210f4cd Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Wed, 10 Mar 2021 15:01:49 +0000 Subject: [PATCH 2/3] test: add new operations to int tests and examples --- .../iam_identity/v1/IamIdentityExamples.java | 45 ++++--- .../iam_identity/v1/IamIdentityIT.java | 120 +++++++++++------- 2 files changed, 99 insertions(+), 66 deletions(-) diff --git a/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java b/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java index 72a950918e..25d019801e 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityExamples.java @@ -79,6 +79,7 @@ protected IamIdentityExamples() { private static String apikeyEtag; private static String svcId; private static String svcIdEtag; + private static String accountSettingsEtag; static { System.setProperty("IBM_CREDENTIALS_FILE", "../../iam_identity.env"); @@ -324,36 +325,42 @@ public static void main(String[] args) throws Exception { } try { - // begin-getAccountSettings - GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder() - .accountId("testString") - .build(); + // begin-getAccountSettings + GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder() + .accountId(accountId) + .build(); - Response response = service.getAccountSettings(getAccountSettingsOptions).execute(); - AccountSettingsResponse accountSettingsResponse = response.getResult(); + Response response = service.getAccountSettings(getAccountSettingsOptions).execute(); + AccountSettingsResponse accountSettingsResponse = response.getResult(); - System.out.println(accountSettingsResponse); - // end-getAccountSettings + accountSettingsEtag = response.getHeaders().values("Etag").get(0); + System.out.println(accountSettingsResponse); + // end-getAccountSettings } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - // begin-updateAccountSettings - UpdateAccountSettingsOptions updateAccountSettingsOptions = new UpdateAccountSettingsOptions.Builder() - .ifMatch("testString") - .accountId("testString") - .build(); + // begin-updateAccountSettings + UpdateAccountSettingsOptions updateAccountSettingsOptions = new UpdateAccountSettingsOptions.Builder() + .ifMatch(accountSettingsEtag) + .accountId(accountId) + .sessionExpirationInSeconds("86400") + .sessionInvalidationInSeconds("7200") + .restrictCreatePlatformApikey("NOT_RESTRICTED") + .restrictCreateServiceId("NOT_RESTRICTED") + .mfa("NONE") + .build(); - Response response = service.updateAccountSettings(updateAccountSettingsOptions).execute(); - AccountSettingsResponse accountSettingsResponse = response.getResult(); + Response response = service.updateAccountSettings(updateAccountSettingsOptions).execute(); + AccountSettingsResponse accountSettingsResponse = response.getResult(); - System.out.println(accountSettingsResponse); - // end-updateAccountSettings + System.out.println(accountSettingsResponse); + // end-updateAccountSettings } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } } } diff --git a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java index 6efbe5eefd..8a889b5c4c 100644 --- a/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java +++ b/modules/iam-identity/src/test/java/com/ibm/cloud/platform_services/iam_identity/v1/IamIdentityIT.java @@ -84,6 +84,8 @@ public class IamIdentityIT extends SdkIntegrationTestBase { private String serviceId1; private String serviceIdEtag1; + private String accountSettingsEtag; + @Override public String getConfigFilename() { return "../../iam_identity.env"; @@ -601,8 +603,8 @@ public void testCreateApiKeyNegative() throws Exception { service.createApiKey(createApiKeyOptions).execute(); fail("Invalid iam_id should not have succeeded!"); } catch (ServiceResponseException e) { - log(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + log(String.format("Service returned status code %s: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); assertEquals(e.getStatusCode(), 400); } } @@ -616,8 +618,8 @@ public void testDeleteApiKeyNegative() throws Exception { service.deleteApiKey(deleteApiKeyOptions).execute(); fail("Invalid apikey id should not have succeeded!"); } catch (ServiceResponseException e) { - log(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + log(String.format("Service returned status code %s: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); assertEquals(e.getStatusCode(), 404); } } @@ -642,7 +644,7 @@ public void testCreateServiceIdNegative() throws Exception { service.createServiceId(createServiceIdOptions).execute(); fail("Invalid account_id should not have succeeded!"); } catch (ServiceResponseException e) { - log(String.format("Service returned status code %s: %s\nError details: %s", + log(String.format("Service returned status code %s: %s\nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); assertEquals(e.getStatusCode(), 400); } @@ -659,7 +661,7 @@ public void testGetServiceIdNegative() throws Exception { service.getServiceId(getServiceIdOptions).execute(); fail("Invalid service id should not have succeeded!"); } catch (ServiceResponseException e) { - log(String.format("Service returned status code %s: %s\nError details: %s", + log(String.format("Service returned status code %s: %s\nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); assertEquals(e.getStatusCode(), 404); } @@ -667,54 +669,78 @@ public void testGetServiceIdNegative() throws Exception { @Test public void testGetAccountSettings() throws Exception { - try { - GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder() - .accountId("testString") - .includeHistory(true) - .build(); - - // Invoke operation - Response response = service.getAccountSettings(getAccountSettingsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + try { + GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder() + .accountId(ACCOUNT_ID) + .includeHistory(false) + .build(); - AccountSettingsResponse accountSettingsResponseResult = response.getResult(); + // Invoke operation + Response response = service.getAccountSettings(getAccountSettingsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AccountSettingsResponse accountSettingsResponseResult = response.getResult(); + + assertNotNull(accountSettingsResponseResult); + log(String.format("\n>>> getAccountSettings response:\n%s", accountSettingsResponseResult)); - assertNotNull(accountSettingsResponseResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } + assertEquals(accountSettingsResponseResult.getAccountId(), ACCOUNT_ID); + assertNotNull(accountSettingsResponseResult.getRestrictCreatePlatformApikey()); + assertNotNull(accountSettingsResponseResult.getRestrictCreateServiceId()); + assertNotNull(accountSettingsResponseResult.getMfa()); + assertNotNull(accountSettingsResponseResult.getSessionExpirationInSeconds()); + assertNotNull(accountSettingsResponseResult.getSessionInvalidationInSeconds()); + + // Grab the Etag value from the response for use in the update operation. + assertNotNull(response.getHeaders().values("Etag")); + assertEquals(response.getHeaders().values("Etag").size(), 1); + accountSettingsEtag = response.getHeaders().values("Etag").get(0); + assertNotNull(accountSettingsEtag); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } } - @Test + @Test(dependsOnMethods = { "testGetAccountSettings" }) public void testUpdateAccountSettings() throws Exception { - try { - UpdateAccountSettingsOptions updateAccountSettingsOptions = new UpdateAccountSettingsOptions.Builder() - .ifMatch("testString") - .accountId("testString") - .restrictCreateServiceId("RESTRICTED") - .restrictCreatePlatformApikey("RESTRICTED") - .allowedIpAddresses("testString") - .mfa("NONE") - .sessionExpirationInSeconds("testString") - .sessionInvalidationInSeconds("testString") - .build(); - - // Invoke operation - Response response = service.updateAccountSettings(updateAccountSettingsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertNotNull(accountSettingsEtag); + try { + UpdateAccountSettingsOptions updateAccountSettingsOptions = new UpdateAccountSettingsOptions.Builder() + .ifMatch(accountSettingsEtag) + .accountId(ACCOUNT_ID) + .restrictCreateServiceId("NOT_RESTRICTED") + .restrictCreatePlatformApikey("NOT_RESTRICTED") +// .allowedIpAddresses("testString") + .mfa("NONE") + .sessionExpirationInSeconds("86400") + .sessionInvalidationInSeconds("7200") + .build(); - AccountSettingsResponse accountSettingsResponseResult = response.getResult(); + // Invoke operation + Response response = service.updateAccountSettings(updateAccountSettingsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - assertNotNull(accountSettingsResponseResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } + AccountSettingsResponse accountSettingsResponseResult = response.getResult(); + assertNotNull(accountSettingsResponseResult); + log(String.format("\n>>> updateAccountSettings response:\n%s", accountSettingsResponseResult)); + + assertNull(accountSettingsResponseResult.getAllowedIpAddresses()); + assertEquals(accountSettingsResponseResult.getAccountId(), updateAccountSettingsOptions.accountId()); + assertEquals(accountSettingsResponseResult.getMfa(), updateAccountSettingsOptions.mfa()); + assertEquals(accountSettingsResponseResult.getRestrictCreatePlatformApikey(), updateAccountSettingsOptions.restrictCreatePlatformApikey()); + assertEquals(accountSettingsResponseResult.getRestrictCreateServiceId(), updateAccountSettingsOptions.restrictCreateServiceId()); + assertEquals(accountSettingsResponseResult.getSessionExpirationInSeconds(), updateAccountSettingsOptions.sessionExpirationInSeconds()); + assertEquals(accountSettingsResponseResult.getSessionInvalidationInSeconds(), updateAccountSettingsOptions.sessionInvalidationInSeconds()); + assertNotEquals(accountSettingsResponseResult.getEntityTag(), accountSettingsEtag); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s\nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } } @AfterClass From f449316de71900ac48d10abb440b72af9b1f914e Mon Sep 17 00:00:00 2001 From: Phil Adams Date: Thu, 11 Mar 2021 08:52:44 -0600 Subject: [PATCH 3/3] chore: update secrets baseline --- .secrets.baseline | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index fb195bec20..fbb89a0748 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "package-lock.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2021-02-24T21:17:07Z", + "generated_at": "2021-03-11T14:50:00Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -249,19 +249,9 @@ "type": "Hex High Entropy String", "verified_result": null } - ], - "modules/user-management/src/test/java/com/ibm/cloud/platform_services/user_management/v1/UserManagementIT.java": [ - { - "hashed_secret": "2fd0f58e94ad6ad73205d72f2bd0daa099b62500", - "is_secret": false, - "is_verified": false, - "line_number": 67, - "type": "Hex High Entropy String", - "verified_result": null - } ] }, - "version": "0.13.1+ibm.29.dss", + "version": "0.13.1+ibm.31.dss", "word_list": { "file": null, "hash": null