All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.chimesdkidentity.DefaultChimeSdkIdentityClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.chimesdkidentity;

import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.chimesdkidentity.internal.ChimeSdkIdentityServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.chimesdkidentity.model.BadRequestException;
import software.amazon.awssdk.services.chimesdkidentity.model.ChimeSdkIdentityException;
import software.amazon.awssdk.services.chimesdkidentity.model.ConflictException;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceAdminRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceAdminResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceBotRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceBotResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceUserRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.CreateAppInstanceUserResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceAdminRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceAdminResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceBotRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceBotResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceUserRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DeleteAppInstanceUserResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DeregisterAppInstanceUserEndpointRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DeregisterAppInstanceUserEndpointResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceAdminRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceAdminResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceBotRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceBotResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceUserEndpointRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceUserEndpointResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceUserRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.DescribeAppInstanceUserResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ForbiddenException;
import software.amazon.awssdk.services.chimesdkidentity.model.GetAppInstanceRetentionSettingsRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.GetAppInstanceRetentionSettingsResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceAdminsRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceAdminsResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceBotsRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceBotsResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceUserEndpointsRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceUserEndpointsResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceUsersRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstanceUsersResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstancesRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.ListAppInstancesResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.NotFoundException;
import software.amazon.awssdk.services.chimesdkidentity.model.PutAppInstanceRetentionSettingsRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.PutAppInstanceRetentionSettingsResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.PutAppInstanceUserExpirationSettingsRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.PutAppInstanceUserExpirationSettingsResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.RegisterAppInstanceUserEndpointRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.RegisterAppInstanceUserEndpointResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ResourceLimitExceededException;
import software.amazon.awssdk.services.chimesdkidentity.model.ServiceFailureException;
import software.amazon.awssdk.services.chimesdkidentity.model.ServiceUnavailableException;
import software.amazon.awssdk.services.chimesdkidentity.model.TagResourceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.TagResourceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.ThrottledClientException;
import software.amazon.awssdk.services.chimesdkidentity.model.UnauthorizedClientException;
import software.amazon.awssdk.services.chimesdkidentity.model.UntagResourceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.UntagResourceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceBotRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceBotResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceUserEndpointRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceUserEndpointResponse;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceUserRequest;
import software.amazon.awssdk.services.chimesdkidentity.model.UpdateAppInstanceUserResponse;
import software.amazon.awssdk.services.chimesdkidentity.transform.CreateAppInstanceAdminRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.CreateAppInstanceBotRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.CreateAppInstanceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.CreateAppInstanceUserRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DeleteAppInstanceAdminRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DeleteAppInstanceBotRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DeleteAppInstanceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DeleteAppInstanceUserRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DeregisterAppInstanceUserEndpointRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DescribeAppInstanceAdminRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DescribeAppInstanceBotRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DescribeAppInstanceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DescribeAppInstanceUserEndpointRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.DescribeAppInstanceUserRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.GetAppInstanceRetentionSettingsRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.ListAppInstanceAdminsRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.ListAppInstanceBotsRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.ListAppInstanceUserEndpointsRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.ListAppInstanceUsersRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.ListAppInstancesRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.PutAppInstanceRetentionSettingsRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.PutAppInstanceUserExpirationSettingsRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.RegisterAppInstanceUserEndpointRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.UpdateAppInstanceBotRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.UpdateAppInstanceRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.UpdateAppInstanceUserEndpointRequestMarshaller;
import software.amazon.awssdk.services.chimesdkidentity.transform.UpdateAppInstanceUserRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

/**
 * Internal implementation of {@link ChimeSdkIdentityClient}.
 *
 * @see ChimeSdkIdentityClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultChimeSdkIdentityClient implements ChimeSdkIdentityClient {
    private static final Logger log = Logger.loggerFor(DefaultChimeSdkIdentityClient.class);

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.REST_JSON).build();

    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultChimeSdkIdentityClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Creates an Amazon Chime SDK messaging AppInstance under an AWS account. Only SDK messaging customers * use this API. CreateAppInstance supports idempotency behavior as described in the AWS API Standard. *

*

* identity *

* * @param createAppInstanceRequest * @return Result of the CreateAppInstance operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.CreateAppInstance * @see AWS API Documentation */ @Override public CreateAppInstanceResponse createAppInstance(CreateAppInstanceRequest createAppInstanceRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateAppInstanceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppInstanceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppInstanceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppInstance"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateAppInstance").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createAppInstanceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateAppInstanceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Promotes an AppInstanceUser or AppInstanceBot to an AppInstanceAdmin. The * promoted entity can perform the following actions. *

*
    *
  • *

    * ChannelModerator actions across all channels in the AppInstance. *

    *
  • *
  • *

    * DeleteChannelMessage actions. *

    *
  • *
*

* Only an AppInstanceUser and AppInstanceBot can be promoted to an * AppInstanceAdmin role. *

* * @param createAppInstanceAdminRequest * @return Result of the CreateAppInstanceAdmin operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.CreateAppInstanceAdmin * @see AWS API Documentation */ @Override public CreateAppInstanceAdminResponse createAppInstanceAdmin(CreateAppInstanceAdminRequest createAppInstanceAdminRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAppInstanceAdminResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppInstanceAdminRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppInstanceAdminRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppInstanceAdmin"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAppInstanceAdmin").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createAppInstanceAdminRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateAppInstanceAdminRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a bot under an Amazon Chime AppInstance. The request consists of a unique * Configuration and Name for that bot. *

* * @param createAppInstanceBotRequest * @return Result of the CreateAppInstanceBot operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.CreateAppInstanceBot * @see AWS API Documentation */ @Override public CreateAppInstanceBotResponse createAppInstanceBot(CreateAppInstanceBotRequest createAppInstanceBotRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAppInstanceBotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppInstanceBotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppInstanceBotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppInstanceBot"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateAppInstanceBot").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createAppInstanceBotRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateAppInstanceBotRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a user under an Amazon Chime AppInstance. The request consists of a unique * appInstanceUserId and Name for that user. *

* * @param createAppInstanceUserRequest * @return Result of the CreateAppInstanceUser operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.CreateAppInstanceUser * @see AWS API Documentation */ @Override public CreateAppInstanceUserResponse createAppInstanceUser(CreateAppInstanceUserRequest createAppInstanceUserRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAppInstanceUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppInstanceUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppInstanceUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppInstanceUser"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateAppInstanceUser").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createAppInstanceUserRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateAppInstanceUserRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an AppInstance and all associated data asynchronously. *

* * @param deleteAppInstanceRequest * @return Result of the DeleteAppInstance operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DeleteAppInstance * @see AWS API Documentation */ @Override public DeleteAppInstanceResponse deleteAppInstance(DeleteAppInstanceRequest deleteAppInstanceRequest) throws BadRequestException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteAppInstanceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAppInstanceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppInstanceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppInstance"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteAppInstance").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteAppInstanceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteAppInstanceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Demotes an AppInstanceAdmin to an AppInstanceUser or AppInstanceBot. This * action does not delete the user. *

* * @param deleteAppInstanceAdminRequest * @return Result of the DeleteAppInstanceAdmin operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DeleteAppInstanceAdmin * @see AWS API Documentation */ @Override public DeleteAppInstanceAdminResponse deleteAppInstanceAdmin(DeleteAppInstanceAdminRequest deleteAppInstanceAdminRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAppInstanceAdminResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAppInstanceAdminRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppInstanceAdminRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppInstanceAdmin"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAppInstanceAdmin").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteAppInstanceAdminRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteAppInstanceAdminRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an AppInstanceBot. *

* * @param deleteAppInstanceBotRequest * @return Result of the DeleteAppInstanceBot operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DeleteAppInstanceBot * @see AWS API Documentation */ @Override public DeleteAppInstanceBotResponse deleteAppInstanceBot(DeleteAppInstanceBotRequest deleteAppInstanceBotRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAppInstanceBotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAppInstanceBotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppInstanceBotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppInstanceBot"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteAppInstanceBot").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteAppInstanceBotRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteAppInstanceBotRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an AppInstanceUser. *

* * @param deleteAppInstanceUserRequest * @return Result of the DeleteAppInstanceUser operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DeleteAppInstanceUser * @see AWS API Documentation */ @Override public DeleteAppInstanceUserResponse deleteAppInstanceUser(DeleteAppInstanceUserRequest deleteAppInstanceUserRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAppInstanceUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAppInstanceUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppInstanceUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppInstanceUser"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteAppInstanceUser").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteAppInstanceUserRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteAppInstanceUserRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deregisters an AppInstanceUserEndpoint. *

* * @param deregisterAppInstanceUserEndpointRequest * @return Result of the DeregisterAppInstanceUserEndpoint operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DeregisterAppInstanceUserEndpoint * @see AWS API Documentation */ @Override public DeregisterAppInstanceUserEndpointResponse deregisterAppInstanceUserEndpoint( DeregisterAppInstanceUserEndpointRequest deregisterAppInstanceUserEndpointRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeregisterAppInstanceUserEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deregisterAppInstanceUserEndpointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deregisterAppInstanceUserEndpointRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeregisterAppInstanceUserEndpoint"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeregisterAppInstanceUserEndpoint").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deregisterAppInstanceUserEndpointRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeregisterAppInstanceUserEndpointRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns the full details of an AppInstance. *

* * @param describeAppInstanceRequest * @return Result of the DescribeAppInstance operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DescribeAppInstance * @see AWS API Documentation */ @Override public DescribeAppInstanceResponse describeAppInstance(DescribeAppInstanceRequest describeAppInstanceRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppInstanceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppInstanceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppInstanceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppInstance"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeAppInstance").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeAppInstanceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeAppInstanceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns the full details of an AppInstanceAdmin. *

* * @param describeAppInstanceAdminRequest * @return Result of the DescribeAppInstanceAdmin operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DescribeAppInstanceAdmin * @see AWS API Documentation */ @Override public DescribeAppInstanceAdminResponse describeAppInstanceAdmin( DescribeAppInstanceAdminRequest describeAppInstanceAdminRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppInstanceAdminResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppInstanceAdminRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppInstanceAdminRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppInstanceAdmin"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppInstanceAdmin").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeAppInstanceAdminRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeAppInstanceAdminRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The AppInstanceBot's information. *

* * @param describeAppInstanceBotRequest * @return Result of the DescribeAppInstanceBot operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws NotFoundException * One or more of the resources in the request does not exist in the system. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DescribeAppInstanceBot * @see AWS API Documentation */ @Override public DescribeAppInstanceBotResponse describeAppInstanceBot(DescribeAppInstanceBotRequest describeAppInstanceBotRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, NotFoundException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppInstanceBotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppInstanceBotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppInstanceBotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppInstanceBot"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppInstanceBot").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeAppInstanceBotRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeAppInstanceBotRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns the full details of an AppInstanceUser. *

* * @param describeAppInstanceUserRequest * @return Result of the DescribeAppInstanceUser operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DescribeAppInstanceUser * @see AWS API Documentation */ @Override public DescribeAppInstanceUserResponse describeAppInstanceUser(DescribeAppInstanceUserRequest describeAppInstanceUserRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppInstanceUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppInstanceUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppInstanceUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppInstanceUser"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppInstanceUser").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeAppInstanceUserRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeAppInstanceUserRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns the full details of an AppInstanceUserEndpoint. *

* * @param describeAppInstanceUserEndpointRequest * @return Result of the DescribeAppInstanceUserEndpoint operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.DescribeAppInstanceUserEndpoint * @see AWS API Documentation */ @Override public DescribeAppInstanceUserEndpointResponse describeAppInstanceUserEndpoint( DescribeAppInstanceUserEndpointRequest describeAppInstanceUserEndpointRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppInstanceUserEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppInstanceUserEndpointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppInstanceUserEndpointRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppInstanceUserEndpoint"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppInstanceUserEndpoint").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeAppInstanceUserEndpointRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeAppInstanceUserEndpointRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets the retention settings for an AppInstance. *

* * @param getAppInstanceRetentionSettingsRequest * @return Result of the GetAppInstanceRetentionSettings operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.GetAppInstanceRetentionSettings * @see AWS API Documentation */ @Override public GetAppInstanceRetentionSettingsResponse getAppInstanceRetentionSettings( GetAppInstanceRetentionSettingsRequest getAppInstanceRetentionSettingsRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetAppInstanceRetentionSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAppInstanceRetentionSettingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getAppInstanceRetentionSettingsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAppInstanceRetentionSettings"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetAppInstanceRetentionSettings").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getAppInstanceRetentionSettingsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetAppInstanceRetentionSettingsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of the administrators in the AppInstance. *

* * @param listAppInstanceAdminsRequest * @return Result of the ListAppInstanceAdmins operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.ListAppInstanceAdmins * @see AWS API Documentation */ @Override public ListAppInstanceAdminsResponse listAppInstanceAdmins(ListAppInstanceAdminsRequest listAppInstanceAdminsRequest) throws BadRequestException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAppInstanceAdminsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAppInstanceAdminsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAppInstanceAdminsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAppInstanceAdmins"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListAppInstanceAdmins").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listAppInstanceAdminsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListAppInstanceAdminsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all AppInstanceBots created under a single AppInstance. *

* * @param listAppInstanceBotsRequest * @return Result of the ListAppInstanceBots operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.ListAppInstanceBots * @see AWS API Documentation */ @Override public ListAppInstanceBotsResponse listAppInstanceBots(ListAppInstanceBotsRequest listAppInstanceBotsRequest) throws BadRequestException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAppInstanceBotsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAppInstanceBotsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAppInstanceBotsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAppInstanceBots"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListAppInstanceBots").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listAppInstanceBotsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListAppInstanceBotsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all the AppInstanceUserEndpoints created under a single AppInstanceUser. *

* * @param listAppInstanceUserEndpointsRequest * @return Result of the ListAppInstanceUserEndpoints operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.ListAppInstanceUserEndpoints * @see AWS API Documentation */ @Override public ListAppInstanceUserEndpointsResponse listAppInstanceUserEndpoints( ListAppInstanceUserEndpointsRequest listAppInstanceUserEndpointsRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAppInstanceUserEndpointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAppInstanceUserEndpointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAppInstanceUserEndpointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAppInstanceUserEndpoints"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAppInstanceUserEndpoints").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listAppInstanceUserEndpointsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListAppInstanceUserEndpointsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List all AppInstanceUsers created under a single AppInstance. *

* * @param listAppInstanceUsersRequest * @return Result of the ListAppInstanceUsers operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.ListAppInstanceUsers * @see AWS API Documentation */ @Override public ListAppInstanceUsersResponse listAppInstanceUsers(ListAppInstanceUsersRequest listAppInstanceUsersRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAppInstanceUsersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAppInstanceUsersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAppInstanceUsersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAppInstanceUsers"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListAppInstanceUsers").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listAppInstanceUsersRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListAppInstanceUsersRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all Amazon Chime AppInstances created under a single AWS account. *

* * @param listAppInstancesRequest * @return Result of the ListAppInstances operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.ListAppInstances * @see AWS API Documentation */ @Override public ListAppInstancesResponse listAppInstances(ListAppInstancesRequest listAppInstancesRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListAppInstancesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAppInstancesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAppInstancesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAppInstances"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListAppInstances").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listAppInstancesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListAppInstancesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the tags applied to an Amazon Chime SDK identity resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws BadRequestException, ForbiddenException, UnauthorizedClientException, ThrottledClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Sets the amount of time in days that a given AppInstance retains data. *

* * @param putAppInstanceRetentionSettingsRequest * @return Result of the PutAppInstanceRetentionSettings operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.PutAppInstanceRetentionSettings * @see AWS API Documentation */ @Override public PutAppInstanceRetentionSettingsResponse putAppInstanceRetentionSettings( PutAppInstanceRetentionSettingsRequest putAppInstanceRetentionSettingsRequest) throws BadRequestException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutAppInstanceRetentionSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putAppInstanceRetentionSettingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putAppInstanceRetentionSettingsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutAppInstanceRetentionSettings"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("PutAppInstanceRetentionSettings").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putAppInstanceRetentionSettingsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutAppInstanceRetentionSettingsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Sets the number of days before the AppInstanceUser is automatically deleted. *

* *

* A background process deletes expired AppInstanceUsers within 6 hours of expiration. Actual deletion * times may vary. *

*

* Expired AppInstanceUsers that have not yet been deleted appear as active, and you can update their * expiration settings. The system honors the new settings. *

*
* * @param putAppInstanceUserExpirationSettingsRequest * @return Result of the PutAppInstanceUserExpirationSettings operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.PutAppInstanceUserExpirationSettings * @see AWS API Documentation */ @Override public PutAppInstanceUserExpirationSettingsResponse putAppInstanceUserExpirationSettings( PutAppInstanceUserExpirationSettingsRequest putAppInstanceUserExpirationSettingsRequest) throws BadRequestException, ConflictException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, PutAppInstanceUserExpirationSettingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putAppInstanceUserExpirationSettingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putAppInstanceUserExpirationSettingsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutAppInstanceUserExpirationSettings"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("PutAppInstanceUserExpirationSettings").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putAppInstanceUserExpirationSettingsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutAppInstanceUserExpirationSettingsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Registers an endpoint under an Amazon Chime AppInstanceUser. The endpoint receives messages for a * user. For push notifications, the endpoint is a mobile device used to receive mobile push notifications for a * user. *

* * @param registerAppInstanceUserEndpointRequest * @return Result of the RegisterAppInstanceUserEndpoint operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.RegisterAppInstanceUserEndpoint * @see AWS API Documentation */ @Override public RegisterAppInstanceUserEndpointResponse registerAppInstanceUserEndpoint( RegisterAppInstanceUserEndpointRequest registerAppInstanceUserEndpointRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RegisterAppInstanceUserEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(registerAppInstanceUserEndpointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, registerAppInstanceUserEndpointRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterAppInstanceUserEndpoint"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("RegisterAppInstanceUserEndpoint").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(registerAppInstanceUserEndpointRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new RegisterAppInstanceUserEndpointRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Applies the specified tags to the specified Amazon Chime SDK identity resource. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.TagResource * @see AWS API Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws BadRequestException, ForbiddenException, UnauthorizedClientException, ResourceLimitExceededException, ThrottledClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Removes the specified tags from the specified Amazon Chime SDK identity resource. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.UntagResource * @see AWS API Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws BadRequestException, ForbiddenException, UnauthorizedClientException, ThrottledClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UntagResource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates AppInstance metadata. *

* * @param updateAppInstanceRequest * @return Result of the UpdateAppInstance operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.UpdateAppInstance * @see AWS API Documentation */ @Override public UpdateAppInstanceResponse updateAppInstance(UpdateAppInstanceRequest updateAppInstanceRequest) throws BadRequestException, ConflictException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateAppInstanceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAppInstanceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAppInstanceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAppInstance"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateAppInstance").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateAppInstanceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateAppInstanceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the name and metadata of an AppInstanceBot. *

* * @param updateAppInstanceBotRequest * @return Result of the UpdateAppInstanceBot operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.UpdateAppInstanceBot * @see AWS API Documentation */ @Override public UpdateAppInstanceBotResponse updateAppInstanceBot(UpdateAppInstanceBotRequest updateAppInstanceBotRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAppInstanceBotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAppInstanceBotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAppInstanceBotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAppInstanceBot"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateAppInstanceBot").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateAppInstanceBotRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateAppInstanceBotRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the details of an AppInstanceUser. You can update names and metadata. *

* * @param updateAppInstanceUserRequest * @return Result of the UpdateAppInstanceUser operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ResourceLimitExceededException * The request exceeds the resource limit. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.UpdateAppInstanceUser * @see AWS API Documentation */ @Override public UpdateAppInstanceUserResponse updateAppInstanceUser(UpdateAppInstanceUserRequest updateAppInstanceUserRequest) throws BadRequestException, ConflictException, ForbiddenException, ResourceLimitExceededException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAppInstanceUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAppInstanceUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAppInstanceUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAppInstanceUser"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateAppInstanceUser").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateAppInstanceUserRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateAppInstanceUserRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the details of an AppInstanceUserEndpoint. You can update the name and * AllowMessage values. *

* * @param updateAppInstanceUserEndpointRequest * @return Result of the UpdateAppInstanceUserEndpoint operation returned by the service. * @throws BadRequestException * The input parameters don't match the service's restrictions. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws ForbiddenException * The client is permanently forbidden from making the request. * @throws ThrottledClientException * The client exceeded its request rate limit. * @throws UnauthorizedClientException * The client is not currently authorized to make the request. * @throws ServiceUnavailableException * The service is currently unavailable. * @throws ServiceFailureException * The service encountered an unexpected error. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws ChimeSdkIdentityException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ChimeSdkIdentityClient.UpdateAppInstanceUserEndpoint * @see AWS API Documentation */ @Override public UpdateAppInstanceUserEndpointResponse updateAppInstanceUserEndpoint( UpdateAppInstanceUserEndpointRequest updateAppInstanceUserEndpointRequest) throws BadRequestException, ConflictException, ForbiddenException, ThrottledClientException, UnauthorizedClientException, ServiceUnavailableException, ServiceFailureException, AwsServiceException, SdkClientException, ChimeSdkIdentityException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAppInstanceUserEndpointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAppInstanceUserEndpointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAppInstanceUserEndpointRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Chime SDK Identity"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAppInstanceUserEndpoint"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAppInstanceUserEndpoint").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateAppInstanceUserEndpointRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateAppInstanceUserEndpointRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } @Override public final String serviceName() { return SERVICE_NAME; } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } ChimeSdkIdentityServiceClientConfigurationBuilder serviceConfigBuilder = new ChimeSdkIdentityServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(ChimeSdkIdentityException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedClientException") .exceptionBuilderSupplier(UnauthorizedClientException::builder).httpStatusCode(401).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotFoundException") .exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceFailureException") .exceptionBuilderSupplier(ServiceFailureException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottledClientException") .exceptionBuilderSupplier(ThrottledClientException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ForbiddenException") .exceptionBuilderSupplier(ForbiddenException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceLimitExceededException") .exceptionBuilderSupplier(ResourceLimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BadRequestException") .exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build()); } @Override public final ChimeSdkIdentityServiceClientConfiguration serviceClientConfiguration() { return new ChimeSdkIdentityServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy