diff --git a/checkstyle.xml b/checkstyle.xml
index a2b473206b..c48805e69a 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -13,7 +13,7 @@ Java Style
-
+
@@ -80,7 +80,7 @@ Java Style
-
+
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 78d6736b47..115aa12bb2 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
@@ -77,6 +77,8 @@ protected IamIdentityExamples() {
private static String apikeyEtag;
private static String svcId;
private static String svcIdEtag;
+ private static String srvIdGroupId;
+ private static String srvIdGroupEtag;
private static String profileId;
private static String profileEtag;
private static String claimRuleId;
@@ -465,6 +467,114 @@ public static void main(String[] args) throws Exception {
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}
+ try {
+ System.out.println("createServiceIdGroup() result:");
+
+ // begin-create_service_id_group
+
+ CreateServiceIdGroupOptions createServiceIdGroupOptions = new CreateServiceIdGroupOptions.Builder()
+ .accountId(accountId)
+ .name(serviceIdName)
+ .description("Example ServiceIdGroup")
+ .build();
+
+ Response response = identityservice.createServiceIdGroup(createServiceIdGroupOptions).execute();
+ ServiceIdGroup serviceIdGroup = response.getResult();
+ srvIdGroupId = serviceIdGroup.getId();
+
+ System.out.println(serviceIdGroup);
+
+ // end-create_service_id_group
+
+ } catch (ServiceResponseException e) {
+ logger.error(String.format("Service returned status code %s: %s\nError details: %s",
+ e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
+ }
+
+ try {
+ System.out.println("getServiceIdGroup() result:");
+
+ // begin-get_service_id_group
+
+ GetServiceIdGroupOptions getServiceIdGroupOptions = new GetServiceIdGroupOptions.Builder()
+ .id(srvIdGroupId)
+ .build();
+
+ Response response = identityservice.getServiceIdGroup(getServiceIdGroupOptions).execute();
+ ServiceIdGroup serviceIdGroup = response.getResult();
+ srvIdGroupEtag = response.getHeaders().values("Etag").get(0);
+
+ System.out.println(serviceIdGroup);
+
+ // end-get_service_id_group
+
+ } catch (ServiceResponseException e) {
+ logger.error(String.format("Service returned status code %s: %s\nError details: %s",
+ e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
+ }
+
+ try {
+ System.out.println("listServiceIdGroup() result:");
+
+ // begin-list_service_id_group
+
+ ListServiceIdGroupOptions listServiceIdGroupOptions = new ListServiceIdGroupOptions.Builder()
+ .accountId(accountId)
+ .build();
+
+ Response response = identityservice.listServiceIdGroup(listServiceIdGroupOptions).execute();
+ ServiceIdGroupList serviceIdGroupList = response.getResult();
+
+ System.out.println(serviceIdGroupList);
+
+ // end-list_service_id_group
+
+ } catch (ServiceResponseException e) {
+ logger.error(String.format("Service returned status code %s: %s\nError details: %s",
+ e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
+ }
+
+ try {
+ System.out.println("updateServiceIdGroup() result:");
+
+ // begin-update_service_id_group
+
+ UpdateServiceIdGroupOptions updateServiceIdGroupOptions = new UpdateServiceIdGroupOptions.Builder()
+ .id(srvIdGroupId)
+ .ifMatch(srvIdGroupEtag)
+ .description("Example ServiceIdGroup updated")
+ .build();
+
+ Response response = identityservice.updateServiceIdGroup(updateServiceIdGroupOptions).execute();
+ ServiceIdGroup serviceIdGroup = response.getResult();
+
+ System.out.println(serviceIdGroup);
+
+ // end-update_service_id_group
+
+ } catch (ServiceResponseException e) {
+ logger.error(String.format("Service returned status code %s: %s\nError details: %s",
+ e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
+ }
+
+ try {
+ System.out.println("deleteServiceIdGroup() result:");
+
+ // begin-delete_service_id_group
+
+ DeleteServiceIdGroupOptions deleteServiceIdGroupOptions = new DeleteServiceIdGroupOptions.Builder()
+ .id(srvIdGroupId)
+ .build();
+
+ identityservice.deleteServiceIdGroup(deleteServiceIdGroupOptions).execute();
+
+ // end-delete_service_id_group
+
+ } catch (ServiceResponseException e) {
+ logger.error(String.format("Service returned status code %s: %s\nError details: %s",
+ e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
+ }
+
try {
System.out.println("createProfile() result:");
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 560d50ee35..ebf4b588bb 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
@@ -12,7 +12,7 @@
*/
/*
- * IBM OpenAPI SDK Code Generator Version: 3.98.0-8be2046a-20241205-162752
+ * IBM OpenAPI SDK Code Generator Version: 3.105.1-067d600b-20250616-154447
*/
package com.ibm.cloud.platform_services.iam_identity.v1;
@@ -22,7 +22,6 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsResponse;
import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsTemplateList;
import com.ibm.cloud.platform_services.iam_identity.v1.model.AccountSettingsTemplateResponse;
-import com.ibm.cloud.platform_services.iam_identity.v1.model.AllIdentityPreferencesResponse;
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.CommitAccountSettingsTemplateOptions;
@@ -38,6 +37,7 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateProfileTemplateOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateProfileTemplateVersionOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateReportOptions;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateServiceIdGroupOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateServiceIdOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.CreateTrustedProfileAssignmentOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteAccountSettingsAssignmentOptions;
@@ -51,6 +51,7 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteProfileIdentityOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteProfileOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteProfileTemplateVersionOptions;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteServiceIdGroupOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteServiceIdOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.DeleteTrustedProfileAssignmentOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.DisableApiKeyOptions;
@@ -76,9 +77,11 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.GetProfileOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.GetProfileTemplateVersionOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.GetReportOptions;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.GetServiceIdGroupOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.GetServiceIdOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.GetTrustedProfileAssignmentOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.IdentityPreferenceResponse;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.IdentityPreferencesResponse;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListAccountSettingsAssignmentsOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListAccountSettingsTemplatesOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListApiKeysOptions;
@@ -86,6 +89,7 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListLinksOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListProfileTemplatesOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListProfilesOptions;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.ListServiceIdGroupOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListServiceIdsOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListTrustedProfileAssignmentsOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ListVersionsOfAccountSettingsTemplateOptions;
@@ -102,6 +106,8 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.ReportMfaEnrollmentStatus;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ReportReference;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceId;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdGroup;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdGroupList;
import com.ibm.cloud.platform_services.iam_identity.v1.model.ServiceIdList;
import com.ibm.cloud.platform_services.iam_identity.v1.model.SetProfileIdentitiesOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.SetProfileIdentityOptions;
@@ -121,6 +127,7 @@
import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdatePreferenceOnScopeAccountOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateProfileOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateProfileTemplateVersionOptions;
+import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateServiceIdGroupOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateServiceIdOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.UpdateTrustedProfileAssignmentOptions;
import com.ibm.cloud.platform_services.iam_identity.v1.model.UserMfaEnrollments;
@@ -189,253 +196,237 @@ public IamIdentity(String serviceName, Authenticator authenticator) {
}
/**
- * Get API keys for a given service or user IAM ID and account ID.
+ * List service IDs.
*
- * Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API
- * keys for themself, or service ID API keys for service IDs they have access to.
+ * Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs
+ * they have access to. Note: apikey details are only included in the response when creating a Service ID with an api
+ * key.
*
- * @param listApiKeysOptions the {@link ListApiKeysOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ApiKeyList}
+ * @param listServiceIdsOptions the {@link ListServiceIdsOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdList}
*/
- public ServiceCall listApiKeys(ListApiKeysOptions listApiKeysOptions) {
- if (listApiKeysOptions == null) {
- listApiKeysOptions = new ListApiKeysOptions.Builder().build();
+ public ServiceCall listServiceIds(ListServiceIdsOptions listServiceIdsOptions) {
+ if (listServiceIdsOptions == null) {
+ listServiceIdsOptions = new ListServiceIdsOptions.Builder().build();
}
- RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys"));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "listApiKeys");
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "listServiceIds");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (listApiKeysOptions.accountId() != null) {
- builder.query("account_id", String.valueOf(listApiKeysOptions.accountId()));
+ if (listServiceIdsOptions.accountId() != null) {
+ builder.query("account_id", String.valueOf(listServiceIdsOptions.accountId()));
}
- if (listApiKeysOptions.iamId() != null) {
- builder.query("iam_id", String.valueOf(listApiKeysOptions.iamId()));
+ if (listServiceIdsOptions.groupId() != null) {
+ builder.query("group_id", String.valueOf(listServiceIdsOptions.groupId()));
}
- if (listApiKeysOptions.pagesize() != null) {
- builder.query("pagesize", String.valueOf(listApiKeysOptions.pagesize()));
+ if (listServiceIdsOptions.name() != null) {
+ builder.query("name", String.valueOf(listServiceIdsOptions.name()));
}
- if (listApiKeysOptions.pagetoken() != null) {
- builder.query("pagetoken", String.valueOf(listApiKeysOptions.pagetoken()));
+ if (listServiceIdsOptions.pagesize() != null) {
+ builder.query("pagesize", String.valueOf(listServiceIdsOptions.pagesize()));
}
- if (listApiKeysOptions.scope() != null) {
- builder.query("scope", String.valueOf(listApiKeysOptions.scope()));
+ if (listServiceIdsOptions.pagetoken() != null) {
+ builder.query("pagetoken", String.valueOf(listServiceIdsOptions.pagetoken()));
}
- if (listApiKeysOptions.type() != null) {
- builder.query("type", String.valueOf(listApiKeysOptions.type()));
+ if (listServiceIdsOptions.sort() != null) {
+ builder.query("sort", String.valueOf(listServiceIdsOptions.sort()));
}
- if (listApiKeysOptions.sort() != null) {
- builder.query("sort", String.valueOf(listApiKeysOptions.sort()));
+ if (listServiceIdsOptions.order() != null) {
+ builder.query("order", String.valueOf(listServiceIdsOptions.order()));
}
- if (listApiKeysOptions.order() != null) {
- builder.query("order", String.valueOf(listApiKeysOptions.order()));
+ if (listServiceIdsOptions.includeHistory() != null) {
+ builder.query("include_history", String.valueOf(listServiceIdsOptions.includeHistory()));
}
- if (listApiKeysOptions.includeHistory() != null) {
- builder.query("include_history", String.valueOf(listApiKeysOptions.includeHistory()));
+ if (listServiceIdsOptions.filter() != null) {
+ builder.query("filter", String.valueOf(listServiceIdsOptions.filter()));
}
- if (listApiKeysOptions.filter() != null) {
- builder.query("filter", String.valueOf(listApiKeysOptions.filter()));
+ if (listServiceIdsOptions.showGroupId() != null) {
+ builder.query("show_group_id", String.valueOf(listServiceIdsOptions.showGroupId()));
}
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Get API keys for a given service or user IAM ID and account ID.
+ * List service IDs.
*
- * Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API
- * keys for themself, or service ID API keys for service IDs they have access to.
+ * Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs
+ * they have access to. Note: apikey details are only included in the response when creating a Service ID with an api
+ * key.
*
- * @return a {@link ServiceCall} with a result of type {@link ApiKeyList}
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdList}
*/
- public ServiceCall listApiKeys() {
- return listApiKeys(null);
+ public ServiceCall listServiceIds() {
+ return listServiceIds(null);
}
/**
- * Create an API key.
+ * Create a service ID.
*
- * Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys
+ * Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys
* for service IDs they have access to.
*
- * @param createApiKeyOptions the {@link CreateApiKeyOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ApiKey}
+ * @param createServiceIdOptions the {@link CreateServiceIdOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceId}
*/
- public ServiceCall createApiKey(CreateApiKeyOptions createApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(createApiKeyOptions,
- "createApiKeyOptions cannot be null");
- RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys"));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "createApiKey");
+ public ServiceCall createServiceId(CreateServiceIdOptions createServiceIdOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(createServiceIdOptions,
+ "createServiceIdOptions cannot be null");
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "createServiceId");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (createApiKeyOptions.entityLock() != null) {
- builder.header("Entity-Lock", createApiKeyOptions.entityLock());
+ if (createServiceIdOptions.entityLock() != null) {
+ builder.header("Entity-Lock", createServiceIdOptions.entityLock());
}
- if (createApiKeyOptions.entityDisable() != null) {
- builder.header("Entity-Disable", createApiKeyOptions.entityDisable());
+ if (createServiceIdOptions.showGroupId() != null) {
+ builder.query("show_group_id", String.valueOf(createServiceIdOptions.showGroupId()));
}
final JsonObject contentJson = new JsonObject();
- contentJson.addProperty("name", createApiKeyOptions.name());
- contentJson.addProperty("iam_id", createApiKeyOptions.iamId());
- if (createApiKeyOptions.description() != null) {
- contentJson.addProperty("description", createApiKeyOptions.description());
- }
- if (createApiKeyOptions.accountId() != null) {
- contentJson.addProperty("account_id", createApiKeyOptions.accountId());
- }
- if (createApiKeyOptions.apikey() != null) {
- contentJson.addProperty("apikey", createApiKeyOptions.apikey());
+ contentJson.addProperty("account_id", createServiceIdOptions.accountId());
+ contentJson.addProperty("name", createServiceIdOptions.name());
+ if (createServiceIdOptions.groupId() != null) {
+ contentJson.addProperty("group_id", createServiceIdOptions.groupId());
}
- if (createApiKeyOptions.storeValue() != null) {
- contentJson.addProperty("store_value", createApiKeyOptions.storeValue());
+ if (createServiceIdOptions.description() != null) {
+ contentJson.addProperty("description", createServiceIdOptions.description());
}
- if (createApiKeyOptions.supportSessions() != null) {
- contentJson.addProperty("support_sessions", createApiKeyOptions.supportSessions());
+ if (createServiceIdOptions.uniqueInstanceCrns() != null) {
+ contentJson.add("unique_instance_crns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createServiceIdOptions.uniqueInstanceCrns()));
}
- if (createApiKeyOptions.actionWhenLeaked() != null) {
- contentJson.addProperty("action_when_leaked", createApiKeyOptions.actionWhenLeaked());
+ if (createServiceIdOptions.apikey() != null) {
+ contentJson.add("apikey", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createServiceIdOptions.apikey()));
}
builder.bodyJson(contentJson);
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Get details of an API key by its value.
+ * Get details of a service ID.
*
- * Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys
- * for service IDs they have access to.
+ * Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for
+ * service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID
+ * with an api key.
*
- * @param getApiKeysDetailsOptions the {@link GetApiKeysDetailsOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ApiKey}
+ * @param getServiceIdOptions the {@link GetServiceIdOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceId}
*/
- public ServiceCall getApiKeysDetails(GetApiKeysDetailsOptions getApiKeysDetailsOptions) {
- if (getApiKeysDetailsOptions == null) {
- getApiKeysDetailsOptions = new GetApiKeysDetailsOptions.Builder().build();
- }
- RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/details"));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getApiKeysDetails");
+ public ServiceCall getServiceId(GetServiceIdOptions getServiceIdOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(getServiceIdOptions,
+ "getServiceIdOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("id", getServiceIdOptions.id());
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getServiceId");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (getApiKeysDetailsOptions.iamApiKey() != null) {
- builder.header("IAM-ApiKey", getApiKeysDetailsOptions.iamApiKey());
+ if (getServiceIdOptions.includeHistory() != null) {
+ builder.query("include_history", String.valueOf(getServiceIdOptions.includeHistory()));
}
- if (getApiKeysDetailsOptions.includeHistory() != null) {
- builder.query("include_history", String.valueOf(getApiKeysDetailsOptions.includeHistory()));
+ if (getServiceIdOptions.includeActivity() != null) {
+ builder.query("include_activity", String.valueOf(getServiceIdOptions.includeActivity()));
}
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ if (getServiceIdOptions.showGroupId() != null) {
+ builder.query("show_group_id", String.valueOf(getServiceIdOptions.showGroupId()));
+ }
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Get details of an API key by its value.
- *
- * Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys
- * for service IDs they have access to.
- *
- * @return a {@link ServiceCall} with a result of type {@link ApiKey}
- */
- public ServiceCall getApiKeysDetails() {
- return getApiKeysDetails(null);
- }
-
- /**
- * Get details of an API key.
+ * Update service ID.
*
- * Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service
- * IDs they have access to.
+ * Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay
+ * unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete
+ * one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or
+ * service ID API keys for service IDs they have access to. Note: apikey details are only included in the response
+ * when creating a Service ID with an apikey.
*
- * @param getApiKeyOptions the {@link GetApiKeyOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ApiKey}
+ * @param updateServiceIdOptions the {@link UpdateServiceIdOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceId}
*/
- public ServiceCall getApiKey(GetApiKeyOptions getApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(getApiKeyOptions,
- "getApiKeyOptions cannot be null");
+ public ServiceCall updateServiceId(UpdateServiceIdOptions updateServiceIdOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(updateServiceIdOptions,
+ "updateServiceIdOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", getApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getApiKey");
+ pathParamsMap.put("id", updateServiceIdOptions.id());
+ RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updateServiceId");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (getApiKeyOptions.includeHistory() != null) {
- builder.query("include_history", String.valueOf(getApiKeyOptions.includeHistory()));
+ builder.header("If-Match", updateServiceIdOptions.ifMatch());
+ if (updateServiceIdOptions.showGroupId() != null) {
+ builder.query("show_group_id", String.valueOf(updateServiceIdOptions.showGroupId()));
}
- if (getApiKeyOptions.includeActivity() != null) {
- builder.query("include_activity", String.valueOf(getApiKeyOptions.includeActivity()));
+ final JsonObject contentJson = new JsonObject();
+ if (updateServiceIdOptions.name() != null) {
+ contentJson.addProperty("name", updateServiceIdOptions.name());
}
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ if (updateServiceIdOptions.description() != null) {
+ contentJson.addProperty("description", updateServiceIdOptions.description());
+ }
+ if (updateServiceIdOptions.uniqueInstanceCrns() != null) {
+ contentJson.add("unique_instance_crns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateServiceIdOptions.uniqueInstanceCrns()));
+ }
+ builder.bodyJson(contentJson);
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Updates an API key.
+ * Deletes a service ID and associated API keys.
*
- * Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay
- * unchanged until the access token is refreshed. To update an API key, pass the property to be modified. To delete
- * one property's value, pass the property with an empty value "". Users can manage user API keys for themself, or
- * service ID API keys for service IDs they have access to.
+ * Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are
+ * deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only
+ * deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself,
+ * or service ID API keys for service IDs they have access to.
*
- * @param updateApiKeyOptions the {@link UpdateApiKeyOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ApiKey}
+ * @param deleteServiceIdOptions the {@link DeleteServiceIdOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a void result
*/
- public ServiceCall updateApiKey(UpdateApiKeyOptions updateApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(updateApiKeyOptions,
- "updateApiKeyOptions cannot be null");
+ public ServiceCall deleteServiceId(DeleteServiceIdOptions deleteServiceIdOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(deleteServiceIdOptions,
+ "deleteServiceIdOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", updateApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updateApiKey");
+ pathParamsMap.put("id", deleteServiceIdOptions.id());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "deleteServiceId");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
- builder.header("Accept", "application/json");
- builder.header("If-Match", updateApiKeyOptions.ifMatch());
- final JsonObject contentJson = new JsonObject();
- if (updateApiKeyOptions.name() != null) {
- contentJson.addProperty("name", updateApiKeyOptions.name());
- }
- if (updateApiKeyOptions.description() != null) {
- contentJson.addProperty("description", updateApiKeyOptions.description());
- }
- if (updateApiKeyOptions.supportSessions() != null) {
- contentJson.addProperty("support_sessions", updateApiKeyOptions.supportSessions());
- }
- if (updateApiKeyOptions.actionWhenLeaked() != null) {
- contentJson.addProperty("action_when_leaked", updateApiKeyOptions.actionWhenLeaked());
- }
- builder.bodyJson(contentJson);
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ ResponseConverter responseConverter = ResponseConverterUtils.getVoid();
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Deletes an API key.
+ * Lock the service ID.
*
- * Deletes an API key. Existing tokens will remain valid until expired. Users can manage user API keys for themself,
- * or service ID API keys for service IDs they have access to.
+ * Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they
+ * have access to.
*
- * @param deleteApiKeyOptions the {@link DeleteApiKeyOptions} containing the options for the call
+ * @param lockServiceIdOptions the {@link LockServiceIdOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
- public ServiceCall deleteApiKey(DeleteApiKeyOptions deleteApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(deleteApiKeyOptions,
- "deleteApiKeyOptions cannot be null");
+ public ServiceCall lockServiceId(LockServiceIdOptions lockServiceIdOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(lockServiceIdOptions,
+ "lockServiceIdOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", deleteApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "deleteApiKey");
+ pathParamsMap.put("id", lockServiceIdOptions.id());
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}/lock", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "lockServiceId");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
@@ -444,21 +435,21 @@ public ServiceCall deleteApiKey(DeleteApiKeyOptions deleteApiKeyOptions) {
}
/**
- * Lock the API key.
+ * Unlock the service ID.
*
- * Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they
- * have access to.
+ * Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs
+ * they have access to.
*
- * @param lockApiKeyOptions the {@link LockApiKeyOptions} containing the options for the call
+ * @param unlockServiceIdOptions the {@link UnlockServiceIdOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
- public ServiceCall lockApiKey(LockApiKeyOptions lockApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(lockApiKeyOptions,
- "lockApiKeyOptions cannot be null");
+ public ServiceCall unlockServiceId(UnlockServiceIdOptions unlockServiceIdOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(unlockServiceIdOptions,
+ "unlockServiceIdOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", lockApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/lock", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "lockApiKey");
+ pathParamsMap.put("id", unlockServiceIdOptions.id());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}/lock", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "unlockServiceId");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
@@ -467,67 +458,141 @@ public ServiceCall lockApiKey(LockApiKeyOptions lockApiKeyOptions) {
}
/**
- * Unlock the API key.
+ * List service ID groups.
*
- * Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they
- * have access to.
+ * Returns a list of all service ID groups for the given account ID.
*
- * @param unlockApiKeyOptions the {@link UnlockApiKeyOptions} containing the options for the call
- * @return a {@link ServiceCall} with a void result
+ * @param listServiceIdGroupOptions the {@link ListServiceIdGroupOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdGroupList}
*/
- public ServiceCall unlockApiKey(UnlockApiKeyOptions unlockApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(unlockApiKeyOptions,
- "unlockApiKeyOptions cannot be null");
+ public ServiceCall listServiceIdGroup(ListServiceIdGroupOptions listServiceIdGroupOptions) {
+ if (listServiceIdGroupOptions == null) {
+ listServiceIdGroupOptions = new ListServiceIdGroupOptions.Builder().build();
+ }
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceid_groups"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "listServiceIdGroup");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ builder.header("Accept", "application/json");
+ if (listServiceIdGroupOptions.accountId() != null) {
+ builder.query("account_id", String.valueOf(listServiceIdGroupOptions.accountId()));
+ }
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
+ /**
+ * List service ID groups.
+ *
+ * Returns a list of all service ID groups for the given account ID.
+ *
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdGroupList}
+ */
+ public ServiceCall listServiceIdGroup() {
+ return listServiceIdGroup(null);
+ }
+
+ /**
+ * Create a service ID group.
+ *
+ * Creates a service ID group for the given account ID.
+ *
+ * @param createServiceIdGroupOptions the {@link CreateServiceIdGroupOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdGroup}
+ */
+ public ServiceCall createServiceIdGroup(CreateServiceIdGroupOptions createServiceIdGroupOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(createServiceIdGroupOptions,
+ "createServiceIdGroupOptions cannot be null");
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceid_groups"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "createServiceIdGroup");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ builder.header("Accept", "application/json");
+ final JsonObject contentJson = new JsonObject();
+ contentJson.addProperty("account_id", createServiceIdGroupOptions.accountId());
+ contentJson.addProperty("name", createServiceIdGroupOptions.name());
+ if (createServiceIdGroupOptions.description() != null) {
+ contentJson.addProperty("description", createServiceIdGroupOptions.description());
+ }
+ builder.bodyJson(contentJson);
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
+ /**
+ * Get details of a service ID group.
+ *
+ * Returns the details of a service ID group.
+ *
+ * @param getServiceIdGroupOptions the {@link GetServiceIdGroupOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdGroup}
+ */
+ public ServiceCall getServiceIdGroup(GetServiceIdGroupOptions getServiceIdGroupOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(getServiceIdGroupOptions,
+ "getServiceIdGroupOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", unlockApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/lock", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "unlockApiKey");
+ pathParamsMap.put("id", getServiceIdGroupOptions.id());
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceid_groups/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getServiceIdGroup");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
- ResponseConverter responseConverter = ResponseConverterUtils.getVoid();
+ builder.header("Accept", "application/json");
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Disable the API key.
+ * Update a service ID group.
*
- * Disable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have
- * access to.
+ * Update a service ID group.
*
- * @param disableApiKeyOptions the {@link DisableApiKeyOptions} containing the options for the call
- * @return a {@link ServiceCall} with a void result
+ * @param updateServiceIdGroupOptions the {@link UpdateServiceIdGroupOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ServiceIdGroup}
*/
- public ServiceCall disableApiKey(DisableApiKeyOptions disableApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(disableApiKeyOptions,
- "disableApiKeyOptions cannot be null");
+ public ServiceCall updateServiceIdGroup(UpdateServiceIdGroupOptions updateServiceIdGroupOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(updateServiceIdGroupOptions,
+ "updateServiceIdGroupOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", disableApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/disable", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "disableApiKey");
+ pathParamsMap.put("id", updateServiceIdGroupOptions.id());
+ RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceid_groups/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updateServiceIdGroup");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
- ResponseConverter responseConverter = ResponseConverterUtils.getVoid();
+ builder.header("Accept", "application/json");
+ builder.header("If-Match", updateServiceIdGroupOptions.ifMatch());
+ final JsonObject contentJson = new JsonObject();
+ contentJson.addProperty("name", updateServiceIdGroupOptions.name());
+ if (updateServiceIdGroupOptions.description() != null) {
+ contentJson.addProperty("description", updateServiceIdGroupOptions.description());
+ }
+ builder.bodyJson(contentJson);
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Enable the API key.
+ * Delete a service ID group.
*
- * Enable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have
- * access to.
+ * Delete a service ID group.
*
- * @param enableApiKeyOptions the {@link EnableApiKeyOptions} containing the options for the call
+ * @param deleteServiceIdGroupOptions the {@link DeleteServiceIdGroupOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
- public ServiceCall enableApiKey(EnableApiKeyOptions enableApiKeyOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(enableApiKeyOptions,
- "enableApiKeyOptions cannot be null");
+ public ServiceCall deleteServiceIdGroup(DeleteServiceIdGroupOptions deleteServiceIdGroupOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(deleteServiceIdGroupOptions,
+ "deleteServiceIdGroupOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", enableApiKeyOptions.id());
- RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/disable", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "enableApiKey");
+ pathParamsMap.put("id", deleteServiceIdGroupOptions.id());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceid_groups/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "deleteServiceIdGroup");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
@@ -536,196 +601,256 @@ public ServiceCall enableApiKey(EnableApiKeyOptions enableApiKeyOptions) {
}
/**
- * List service IDs.
+ * Get API keys for a given service or user IAM ID and account ID.
*
- * Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs
- * they have access to. Note: apikey details are only included in the response when creating a Service ID with an api
- * key.
+ * Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API
+ * keys for themself, or service ID API keys for service IDs they have access to.
*
- * @param listServiceIdsOptions the {@link ListServiceIdsOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ServiceIdList}
+ * @param listApiKeysOptions the {@link ListApiKeysOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ApiKeyList}
*/
- public ServiceCall listServiceIds(ListServiceIdsOptions listServiceIdsOptions) {
- if (listServiceIdsOptions == null) {
- listServiceIdsOptions = new ListServiceIdsOptions.Builder().build();
+ public ServiceCall listApiKeys(ListApiKeysOptions listApiKeysOptions) {
+ if (listApiKeysOptions == null) {
+ listApiKeysOptions = new ListApiKeysOptions.Builder().build();
}
- RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/"));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "listServiceIds");
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "listApiKeys");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (listServiceIdsOptions.accountId() != null) {
- builder.query("account_id", String.valueOf(listServiceIdsOptions.accountId()));
+ if (listApiKeysOptions.accountId() != null) {
+ builder.query("account_id", String.valueOf(listApiKeysOptions.accountId()));
}
- if (listServiceIdsOptions.name() != null) {
- builder.query("name", String.valueOf(listServiceIdsOptions.name()));
+ if (listApiKeysOptions.iamId() != null) {
+ builder.query("iam_id", String.valueOf(listApiKeysOptions.iamId()));
}
- if (listServiceIdsOptions.pagesize() != null) {
- builder.query("pagesize", String.valueOf(listServiceIdsOptions.pagesize()));
+ if (listApiKeysOptions.pagesize() != null) {
+ builder.query("pagesize", String.valueOf(listApiKeysOptions.pagesize()));
}
- if (listServiceIdsOptions.pagetoken() != null) {
- builder.query("pagetoken", String.valueOf(listServiceIdsOptions.pagetoken()));
+ if (listApiKeysOptions.pagetoken() != null) {
+ builder.query("pagetoken", String.valueOf(listApiKeysOptions.pagetoken()));
}
- if (listServiceIdsOptions.sort() != null) {
- builder.query("sort", String.valueOf(listServiceIdsOptions.sort()));
+ if (listApiKeysOptions.scope() != null) {
+ builder.query("scope", String.valueOf(listApiKeysOptions.scope()));
}
- if (listServiceIdsOptions.order() != null) {
- builder.query("order", String.valueOf(listServiceIdsOptions.order()));
+ if (listApiKeysOptions.type() != null) {
+ builder.query("type", String.valueOf(listApiKeysOptions.type()));
}
- if (listServiceIdsOptions.includeHistory() != null) {
- builder.query("include_history", String.valueOf(listServiceIdsOptions.includeHistory()));
+ if (listApiKeysOptions.sort() != null) {
+ builder.query("sort", String.valueOf(listApiKeysOptions.sort()));
}
- if (listServiceIdsOptions.filter() != null) {
- builder.query("filter", String.valueOf(listServiceIdsOptions.filter()));
+ if (listApiKeysOptions.order() != null) {
+ builder.query("order", String.valueOf(listApiKeysOptions.order()));
}
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ if (listApiKeysOptions.includeHistory() != null) {
+ builder.query("include_history", String.valueOf(listApiKeysOptions.includeHistory()));
+ }
+ if (listApiKeysOptions.filter() != null) {
+ builder.query("filter", String.valueOf(listApiKeysOptions.filter()));
+ }
+ if (listApiKeysOptions.groupId() != null) {
+ builder.query("group_id", String.valueOf(listApiKeysOptions.groupId()));
+ }
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * List service IDs.
+ * Get API keys for a given service or user IAM ID and account ID.
*
- * Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs
- * they have access to. Note: apikey details are only included in the response when creating a Service ID with an api
- * key.
+ * Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API
+ * keys for themself, or service ID API keys for service IDs they have access to.
*
- * @return a {@link ServiceCall} with a result of type {@link ServiceIdList}
+ * @return a {@link ServiceCall} with a result of type {@link ApiKeyList}
*/
- public ServiceCall listServiceIds() {
- return listServiceIds(null);
+ public ServiceCall listApiKeys() {
+ return listApiKeys(null);
}
/**
- * Create a service ID.
+ * Create an API key.
*
- * Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys
+ * Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys
* for service IDs they have access to.
*
- * @param createServiceIdOptions the {@link CreateServiceIdOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ServiceId}
+ * @param createApiKeyOptions the {@link CreateApiKeyOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ApiKey}
*/
- public ServiceCall createServiceId(CreateServiceIdOptions createServiceIdOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(createServiceIdOptions,
- "createServiceIdOptions cannot be null");
- RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/"));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "createServiceId");
+ public ServiceCall createApiKey(CreateApiKeyOptions createApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(createApiKeyOptions,
+ "createApiKeyOptions cannot be null");
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "createApiKey");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (createServiceIdOptions.entityLock() != null) {
- builder.header("Entity-Lock", createServiceIdOptions.entityLock());
+ if (createApiKeyOptions.entityLock() != null) {
+ builder.header("Entity-Lock", createApiKeyOptions.entityLock());
+ }
+ if (createApiKeyOptions.entityDisable() != null) {
+ builder.header("Entity-Disable", createApiKeyOptions.entityDisable());
}
final JsonObject contentJson = new JsonObject();
- contentJson.addProperty("account_id", createServiceIdOptions.accountId());
- contentJson.addProperty("name", createServiceIdOptions.name());
- if (createServiceIdOptions.description() != null) {
- contentJson.addProperty("description", createServiceIdOptions.description());
+ contentJson.addProperty("name", createApiKeyOptions.name());
+ contentJson.addProperty("iam_id", createApiKeyOptions.iamId());
+ if (createApiKeyOptions.description() != null) {
+ contentJson.addProperty("description", createApiKeyOptions.description());
}
- if (createServiceIdOptions.uniqueInstanceCrns() != null) {
- contentJson.add("unique_instance_crns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createServiceIdOptions.uniqueInstanceCrns()));
+ if (createApiKeyOptions.accountId() != null) {
+ contentJson.addProperty("account_id", createApiKeyOptions.accountId());
}
- if (createServiceIdOptions.apikey() != null) {
- contentJson.add("apikey", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createServiceIdOptions.apikey()));
+ if (createApiKeyOptions.apikey() != null) {
+ contentJson.addProperty("apikey", createApiKeyOptions.apikey());
+ }
+ if (createApiKeyOptions.storeValue() != null) {
+ contentJson.addProperty("store_value", createApiKeyOptions.storeValue());
+ }
+ if (createApiKeyOptions.supportSessions() != null) {
+ contentJson.addProperty("support_sessions", createApiKeyOptions.supportSessions());
+ }
+ if (createApiKeyOptions.actionWhenLeaked() != null) {
+ contentJson.addProperty("action_when_leaked", createApiKeyOptions.actionWhenLeaked());
}
builder.bodyJson(contentJson);
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Get details of a service ID.
+ * Get details of an API key by its value.
*
- * Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for
- * service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID
- * with an api key.
+ * Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys
+ * for service IDs they have access to.
*
- * @param getServiceIdOptions the {@link GetServiceIdOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ServiceId}
+ * @param getApiKeysDetailsOptions the {@link GetApiKeysDetailsOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ApiKey}
*/
- public ServiceCall getServiceId(GetServiceIdOptions getServiceIdOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(getServiceIdOptions,
- "getServiceIdOptions cannot be null");
+ public ServiceCall getApiKeysDetails(GetApiKeysDetailsOptions getApiKeysDetailsOptions) {
+ if (getApiKeysDetailsOptions == null) {
+ getApiKeysDetailsOptions = new GetApiKeysDetailsOptions.Builder().build();
+ }
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/details"));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getApiKeysDetails");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ builder.header("Accept", "application/json");
+ if (getApiKeysDetailsOptions.iamApiKey() != null) {
+ builder.header("IAM-ApiKey", getApiKeysDetailsOptions.iamApiKey());
+ }
+ if (getApiKeysDetailsOptions.includeHistory() != null) {
+ builder.query("include_history", String.valueOf(getApiKeysDetailsOptions.includeHistory()));
+ }
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
+ /**
+ * Get details of an API key by its value.
+ *
+ * Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys
+ * for service IDs they have access to.
+ *
+ * @return a {@link ServiceCall} with a result of type {@link ApiKey}
+ */
+ public ServiceCall getApiKeysDetails() {
+ return getApiKeysDetails(null);
+ }
+
+ /**
+ * Get details of an API key.
+ *
+ * Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service
+ * IDs they have access to.
+ *
+ * @param getApiKeyOptions the {@link GetApiKeyOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ApiKey}
+ */
+ public ServiceCall getApiKey(GetApiKeyOptions getApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(getApiKeyOptions,
+ "getApiKeyOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", getServiceIdOptions.id());
- RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getServiceId");
+ pathParamsMap.put("id", getApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getApiKey");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (getServiceIdOptions.includeHistory() != null) {
- builder.query("include_history", String.valueOf(getServiceIdOptions.includeHistory()));
+ if (getApiKeyOptions.includeHistory() != null) {
+ builder.query("include_history", String.valueOf(getApiKeyOptions.includeHistory()));
}
- if (getServiceIdOptions.includeActivity() != null) {
- builder.query("include_activity", String.valueOf(getServiceIdOptions.includeActivity()));
+ if (getApiKeyOptions.includeActivity() != null) {
+ builder.query("include_activity", String.valueOf(getApiKeyOptions.includeActivity()));
}
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Update service ID.
+ * Updates an API key.
*
- * Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay
- * unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete
- * one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or
- * service ID API keys for service IDs they have access to. Note: apikey details are only included in the response
- * when creating a Service ID with an apikey.
+ * Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay
+ * unchanged until the access token is refreshed. To update an API key, pass the property to be modified. To delete
+ * one property's value, pass the property with an empty value "". Users can manage user API keys for themself, or
+ * service ID API keys for service IDs they have access to.
*
- * @param updateServiceIdOptions the {@link UpdateServiceIdOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link ServiceId}
+ * @param updateApiKeyOptions the {@link UpdateApiKeyOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ApiKey}
*/
- public ServiceCall updateServiceId(UpdateServiceIdOptions updateServiceIdOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(updateServiceIdOptions,
- "updateServiceIdOptions cannot be null");
+ public ServiceCall updateApiKey(UpdateApiKeyOptions updateApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(updateApiKeyOptions,
+ "updateApiKeyOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", updateServiceIdOptions.id());
- RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updateServiceId");
+ pathParamsMap.put("id", updateApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updateApiKey");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- builder.header("If-Match", updateServiceIdOptions.ifMatch());
+ builder.header("If-Match", updateApiKeyOptions.ifMatch());
final JsonObject contentJson = new JsonObject();
- if (updateServiceIdOptions.name() != null) {
- contentJson.addProperty("name", updateServiceIdOptions.name());
+ if (updateApiKeyOptions.name() != null) {
+ contentJson.addProperty("name", updateApiKeyOptions.name());
}
- if (updateServiceIdOptions.description() != null) {
- contentJson.addProperty("description", updateServiceIdOptions.description());
+ if (updateApiKeyOptions.description() != null) {
+ contentJson.addProperty("description", updateApiKeyOptions.description());
}
- if (updateServiceIdOptions.uniqueInstanceCrns() != null) {
- contentJson.add("unique_instance_crns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateServiceIdOptions.uniqueInstanceCrns()));
+ if (updateApiKeyOptions.supportSessions() != null) {
+ contentJson.addProperty("support_sessions", updateApiKeyOptions.supportSessions());
+ }
+ if (updateApiKeyOptions.actionWhenLeaked() != null) {
+ contentJson.addProperty("action_when_leaked", updateApiKeyOptions.actionWhenLeaked());
}
builder.bodyJson(contentJson);
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * Deletes a service ID and associated API keys.
+ * Deletes an API key.
*
- * Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are
- * deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only
- * deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself,
+ * Deletes an API key. Existing tokens will remain valid until expired. Users can manage user API keys for themself,
* or service ID API keys for service IDs they have access to.
*
- * @param deleteServiceIdOptions the {@link DeleteServiceIdOptions} containing the options for the call
+ * @param deleteApiKeyOptions the {@link DeleteApiKeyOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
- public ServiceCall deleteServiceId(DeleteServiceIdOptions deleteServiceIdOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(deleteServiceIdOptions,
- "deleteServiceIdOptions cannot be null");
+ public ServiceCall deleteApiKey(DeleteApiKeyOptions deleteApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(deleteApiKeyOptions,
+ "deleteApiKeyOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", deleteServiceIdOptions.id());
- RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "deleteServiceId");
+ pathParamsMap.put("id", deleteApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "deleteApiKey");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
@@ -734,21 +859,21 @@ public ServiceCall deleteServiceId(DeleteServiceIdOptions deleteServiceIdO
}
/**
- * Lock the service ID.
+ * Lock the API key.
*
- * Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they
+ * Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they
* have access to.
*
- * @param lockServiceIdOptions the {@link LockServiceIdOptions} containing the options for the call
+ * @param lockApiKeyOptions the {@link LockApiKeyOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
- public ServiceCall lockServiceId(LockServiceIdOptions lockServiceIdOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(lockServiceIdOptions,
- "lockServiceIdOptions cannot be null");
+ public ServiceCall lockApiKey(LockApiKeyOptions lockApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(lockApiKeyOptions,
+ "lockApiKeyOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", lockServiceIdOptions.id());
- RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}/lock", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "lockServiceId");
+ pathParamsMap.put("id", lockApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/lock", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "lockApiKey");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
@@ -757,21 +882,67 @@ public ServiceCall lockServiceId(LockServiceIdOptions lockServiceIdOptions
}
/**
- * Unlock the service ID.
+ * Unlock the API key.
*
- * Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs
- * they have access to.
+ * Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they
+ * have access to.
*
- * @param unlockServiceIdOptions the {@link UnlockServiceIdOptions} containing the options for the call
+ * @param unlockApiKeyOptions the {@link UnlockApiKeyOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
- public ServiceCall unlockServiceId(UnlockServiceIdOptions unlockServiceIdOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(unlockServiceIdOptions,
- "unlockServiceIdOptions cannot be null");
+ public ServiceCall unlockApiKey(UnlockApiKeyOptions unlockApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(unlockApiKeyOptions,
+ "unlockApiKeyOptions cannot be null");
Map pathParamsMap = new HashMap();
- pathParamsMap.put("id", unlockServiceIdOptions.id());
- RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/serviceids/{id}/lock", pathParamsMap));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "unlockServiceId");
+ pathParamsMap.put("id", unlockApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/lock", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "unlockApiKey");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ ResponseConverter responseConverter = ResponseConverterUtils.getVoid();
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
+ /**
+ * Disable the API key.
+ *
+ * Disable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have
+ * access to.
+ *
+ * @param disableApiKeyOptions the {@link DisableApiKeyOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a void result
+ */
+ public ServiceCall disableApiKey(DisableApiKeyOptions disableApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(disableApiKeyOptions,
+ "disableApiKeyOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("id", disableApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/disable", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "disableApiKey");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ ResponseConverter responseConverter = ResponseConverterUtils.getVoid();
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
+ /**
+ * Enable the API key.
+ *
+ * Enable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have
+ * access to.
+ *
+ * @param enableApiKeyOptions the {@link EnableApiKeyOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a void result
+ */
+ public ServiceCall enableApiKey(EnableApiKeyOptions enableApiKeyOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(enableApiKeyOptions,
+ "enableApiKeyOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("id", enableApiKeyOptions.id());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/apikeys/{id}/disable", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "enableApiKey");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
@@ -802,6 +973,9 @@ public ServiceCall createProfile(CreateProfileOptions createProf
if (createProfileOptions.description() != null) {
contentJson.addProperty("description", createProfileOptions.description());
}
+ if (createProfileOptions.email() != null) {
+ contentJson.addProperty("email", createProfileOptions.email());
+ }
builder.bodyJson(contentJson);
ResponseConverter responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
@@ -908,6 +1082,9 @@ public ServiceCall updateProfile(UpdateProfileOptions updateProf
if (updateProfileOptions.description() != null) {
contentJson.addProperty("description", updateProfileOptions.description());
}
+ if (updateProfileOptions.email() != null) {
+ contentJson.addProperty("email", updateProfileOptions.email());
+ }
builder.bodyJson(contentJson);
ResponseConverter responseConverter =
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
@@ -1260,9 +1437,11 @@ public ServiceCall setProfileIdentities(SetProfileIde
/**
* Add a specific identity that can assume the trusted profile.
*
- * Add a specific identity that can assume the trusted profile. This API will update the trusted profile itself, thus
- * calling it repeatedly for the same profile can lead to conflicts responded with HTTP code 409. Make sure to call
- * this API only once in a few seconds for the same trusted profile.
+ * Add a specific identity that can assume the trusted profile.
+ *
+ * **Note:** This API will update the trusted profile itself, thus calling it repeatedly for the same profile can
+ * lead to conflicts responded with HTTP code 409. Make sure to call this API only once in a few seconds for the
+ * same trusted profile.
*
* @param setProfileIdentityOptions the {@link SetProfileIdentityOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link ProfileIdentityResponse}
@@ -1321,10 +1500,14 @@ public ServiceCall getProfileIdentity(GetProfileIdentit
}
/**
- * Delete the identity that can assume the trusted profile. This API will update the trusted profile itself, thus calling it repeatedly for the same profile can lead to conflicts responded with HTTP code 409. Make sure to call this API only once in a few seconds for the same trusted profile.
+ * Delete the identity that can assume the trusted profile.
*
* Delete the identity that can assume the trusted profile.
*
+ * **Note:** This API will update the trusted profile itself, thus calling it repeatedly for the same profile can
+ * lead to conflicts responded with HTTP code 409. Make sure to call this API only once in a few seconds for the
+ * same trusted profile.
+ *
* @param deleteProfileIdentityOptions the {@link DeleteProfileIdentityOptions} containing the options for the call
* @return a {@link ServiceCall} with a void result
*/
@@ -1345,28 +1528,85 @@ public ServiceCall deleteProfileIdentity(DeleteProfileIdentityOptions dele
}
/**
- * Get account configurations.
+ * Trigger activity report for the account.
*
- * Returns the details of an account's configuration.
+ * Trigger activity report for the account by specifying the account ID. It can take a few minutes to generate the
+ * report for retrieval.
*
- * @param getAccountSettingsOptions the {@link GetAccountSettingsOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link AccountSettingsResponse}
+ * @param createReportOptions the {@link CreateReportOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ReportReference}
*/
- public ServiceCall getAccountSettings(GetAccountSettingsOptions getAccountSettingsOptions) {
- com.ibm.cloud.sdk.core.util.Validator.notNull(getAccountSettingsOptions,
- "getAccountSettingsOptions cannot be null");
+ public ServiceCall createReport(CreateReportOptions createReportOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(createReportOptions,
+ "createReportOptions 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");
+ pathParamsMap.put("account_id", createReportOptions.accountId());
+ RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/activity/accounts/{account_id}/report", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "createReport");
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()));
+ if (createReportOptions.type() != null) {
+ builder.query("type", String.valueOf(createReportOptions.type()));
}
- ResponseConverter responseConverter =
+ if (createReportOptions.duration() != null) {
+ builder.query("duration", String.valueOf(createReportOptions.duration()));
+ }
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
+ /**
+ * Get activity report for the account.
+ *
+ * Get activity report for the account by specifying the account ID and the reference that is generated by triggering
+ * the report. Reports older than a day are deleted when generating a new report.
+ *
+ * @param getReportOptions the {@link GetReportOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Report}
+ */
+ public ServiceCall getReport(GetReportOptions getReportOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(getReportOptions,
+ "getReportOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("account_id", getReportOptions.accountId());
+ pathParamsMap.put("reference", getReportOptions.reference());
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/activity/accounts/{account_id}/report/{reference}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getReport");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ builder.header("Accept", "application/json");
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ 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);
}
@@ -1429,6 +1669,36 @@ public ServiceCall updateAccountSettings(UpdateAccountS
return createServiceCall(builder.build(), responseConverter);
}
+ /**
+ * Get effective account settings configuration.
+ *
+ * Returns effective account settings for given account ID.
+ *
+ * @param getEffectiveAccountSettingsOptions the {@link GetEffectiveAccountSettingsOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link EffectiveAccountSettingsResponse}
+ */
+ public ServiceCall getEffectiveAccountSettings(GetEffectiveAccountSettingsOptions getEffectiveAccountSettingsOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(getEffectiveAccountSettingsOptions,
+ "getEffectiveAccountSettingsOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("account_id", getEffectiveAccountSettingsOptions.accountId());
+ RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/accounts/{account_id}/effective_settings/identity", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "getEffectiveAccountSettings");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ builder.header("Accept", "application/json");
+ if (getEffectiveAccountSettingsOptions.includeHistory() != null) {
+ builder.query("include_history", String.valueOf(getEffectiveAccountSettingsOptions.includeHistory()));
+ }
+ if (getEffectiveAccountSettingsOptions.resolveUserMfa() != null) {
+ builder.query("resolve_user_mfa", String.valueOf(getEffectiveAccountSettingsOptions.resolveUserMfa()));
+ }
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ return createServiceCall(builder.build(), responseConverter);
+ }
+
/**
* Get MFA enrollment status for a single user in the account.
*
@@ -1509,320 +1779,330 @@ public ServiceCall getMfaReport(GetMfaReportOptions g
}
/**
- * List assignments.
+ * Update Identity Preference on scope account.
*
- * List account settings assignments.
+ * Update one Identity Preference on scope `account`.
*
- * @param listAccountSettingsAssignmentsOptions the {@link ListAccountSettingsAssignmentsOptions} containing the options for the call
- * @return a {@link ServiceCall} with a result of type {@link TemplateAssignmentListResponse}
+ * The following preferences are storing values for identities inside an account, i.e. for each account that an
+ * identity is member of, the value stored might be different. This means, **users** who might be member of multiple
+ * accounts can have multiple preferences, one per account. Identities like **Service Ids** or **Trusted Profiles**
+ * can only exist in one account, therefore they can only have one preference inside their related account.
+ *
+ * ### Preferences
+ *
+ * - **console/landing_page**
+ *
+ * service: `console`
+ *
+ * preference_id: `landing_page`
+ *
+ * supported identity types: `Trusted Profile`
+ *
+ * type: `string`
+ *
+ * validation: valid path for the IBM Cloud Console (without host part), e.g. `/billing` or `/iam`
+ *
+ * - **console/global_left_navigation**
+ *
+ * service: `console`
+ *
+ * preference_id: `global_left_navigation`
+ *
+ * supported identity types: `Trusted Profile`
+ *
+ * type: `list of strings`
+ *
+ * validation: each entry in the list of strings must match the identifier of one navigation entry in the console;
+ * these identifiers are defined and interpreted by the IBM Cloud Console; currently the following entries are
+ * supported:
+ *
+ * `slash,projects,rex,containers,databases,is,logmet,automation,complianceAndSecurity,apis,cp4d,partner-center,sap,satellite,vmWare,watsonx`
+ *
+ * ### Authorization
+ *
+ * To call this method for the identity type `Trusted Profile`, you must be assigned one or more IAM access roles that
+ * include the following action on the target resource `account` and resource type `preferences`:
+ *
+ * - iam-identity.preferences.update
+ *
+ * By default, the `Administrator` role on service `iam-identity` contains this action.
+ *
+ * @param updatePreferenceOnScopeAccountOptions the {@link UpdatePreferenceOnScopeAccountOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link IdentityPreferenceResponse}
*/
- public ServiceCall listAccountSettingsAssignments(ListAccountSettingsAssignmentsOptions listAccountSettingsAssignmentsOptions) {
- if (listAccountSettingsAssignmentsOptions == null) {
- listAccountSettingsAssignmentsOptions = new ListAccountSettingsAssignmentsOptions.Builder().build();
- }
- RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/account_settings_assignments/"));
- Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "listAccountSettingsAssignments");
+ public ServiceCall updatePreferenceOnScopeAccount(UpdatePreferenceOnScopeAccountOptions updatePreferenceOnScopeAccountOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(updatePreferenceOnScopeAccountOptions,
+ "updatePreferenceOnScopeAccountOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("account_id", updatePreferenceOnScopeAccountOptions.accountId());
+ pathParamsMap.put("iam_id", updatePreferenceOnScopeAccountOptions.iamId());
+ pathParamsMap.put("service", updatePreferenceOnScopeAccountOptions.service());
+ pathParamsMap.put("preference_id", updatePreferenceOnScopeAccountOptions.preferenceId());
+ RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "updatePreferenceOnScopeAccount");
for (Entry header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
- if (listAccountSettingsAssignmentsOptions.accountId() != null) {
- builder.query("account_id", String.valueOf(listAccountSettingsAssignmentsOptions.accountId()));
- }
- if (listAccountSettingsAssignmentsOptions.templateId() != null) {
- builder.query("template_id", String.valueOf(listAccountSettingsAssignmentsOptions.templateId()));
- }
- if (listAccountSettingsAssignmentsOptions.templateVersion() != null) {
- builder.query("template_version", String.valueOf(listAccountSettingsAssignmentsOptions.templateVersion()));
- }
- if (listAccountSettingsAssignmentsOptions.target() != null) {
- builder.query("target", String.valueOf(listAccountSettingsAssignmentsOptions.target()));
- }
- if (listAccountSettingsAssignmentsOptions.targetType() != null) {
- builder.query("target_type", String.valueOf(listAccountSettingsAssignmentsOptions.targetType()));
- }
- if (listAccountSettingsAssignmentsOptions.limit() != null) {
- builder.query("limit", String.valueOf(listAccountSettingsAssignmentsOptions.limit()));
- }
- if (listAccountSettingsAssignmentsOptions.pagetoken() != null) {
- builder.query("pagetoken", String.valueOf(listAccountSettingsAssignmentsOptions.pagetoken()));
- }
- if (listAccountSettingsAssignmentsOptions.sort() != null) {
- builder.query("sort", String.valueOf(listAccountSettingsAssignmentsOptions.sort()));
- }
- if (listAccountSettingsAssignmentsOptions.order() != null) {
- builder.query("order", String.valueOf(listAccountSettingsAssignmentsOptions.order()));
- }
- if (listAccountSettingsAssignmentsOptions.includeHistory() != null) {
- builder.query("include_history", String.valueOf(listAccountSettingsAssignmentsOptions.includeHistory()));
+ final JsonObject contentJson = new JsonObject();
+ contentJson.addProperty("value_string", updatePreferenceOnScopeAccountOptions.valueString());
+ if (updatePreferenceOnScopeAccountOptions.valueListOfStrings() != null) {
+ contentJson.add("value_list_of_strings", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updatePreferenceOnScopeAccountOptions.valueListOfStrings()));
}
- ResponseConverter responseConverter =
- ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
+ builder.bodyJson(contentJson);
+ ResponseConverter responseConverter =
+ ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType());
return createServiceCall(builder.build(), responseConverter);
}
/**
- * List assignments.
+ * Delete Identity Preference on scope account.
*
- * List account settings assignments.
+ * Delete one Identity Preference on scope `account`. For details about the preferences supported and how the method
+ * request is authorized, refer to the description of operation
+ * `Update Identity Preference on scope account`.
*
- * @return a {@link ServiceCall} with a result of type {@link TemplateAssignmentListResponse}
+ * @param deletePreferencesOnScopeAccountOptions the {@link DeletePreferencesOnScopeAccountOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a void result
*/
- public ServiceCall listAccountSettingsAssignments() {
- return listAccountSettingsAssignments(null);
+ public ServiceCall deletePreferencesOnScopeAccount(DeletePreferencesOnScopeAccountOptions deletePreferencesOnScopeAccountOptions) {
+ com.ibm.cloud.sdk.core.util.Validator.notNull(deletePreferencesOnScopeAccountOptions,
+ "deletePreferencesOnScopeAccountOptions cannot be null");
+ Map pathParamsMap = new HashMap();
+ pathParamsMap.put("account_id", deletePreferencesOnScopeAccountOptions.accountId());
+ pathParamsMap.put("iam_id", deletePreferencesOnScopeAccountOptions.iamId());
+ pathParamsMap.put("service", deletePreferencesOnScopeAccountOptions.service());
+ pathParamsMap.put("preference_id", deletePreferencesOnScopeAccountOptions.preferenceId());
+ RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}", pathParamsMap));
+ Map sdkHeaders = SdkCommon.getSdkHeaders("iam_identity", "v1", "deletePreferencesOnScopeAccount");
+ for (Entry header : sdkHeaders.entrySet()) {
+ builder.header(header.getKey(), header.getValue());
+ }
+ ResponseConverter