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

software.amazon.awssdk.services.connectcampaignsv2.DefaultConnectCampaignsV2Client Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Connect Campaigns V2 module holds the client classes that are used for communicating with Connect Campaigns V2.

There is a newer version: 2.29.19
Show newest version
/*
 * 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.connectcampaignsv2;

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.connectcampaignsv2.internal.ConnectCampaignsV2ServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.connectcampaignsv2.model.AccessDeniedException;
import software.amazon.awssdk.services.connectcampaignsv2.model.ConflictException;
import software.amazon.awssdk.services.connectcampaignsv2.model.ConnectCampaignsV2Exception;
import software.amazon.awssdk.services.connectcampaignsv2.model.CreateCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.CreateCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignChannelSubtypeConfigRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignChannelSubtypeConfigResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignCommunicationLimitsRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignCommunicationLimitsResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignCommunicationTimeRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignCommunicationTimeResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteConnectInstanceConfigRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteConnectInstanceConfigResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteConnectInstanceIntegrationRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteConnectInstanceIntegrationResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteInstanceOnboardingJobRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DeleteInstanceOnboardingJobResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.DescribeCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.DescribeCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetCampaignStateBatchRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetCampaignStateBatchResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetCampaignStateRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetCampaignStateResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetConnectInstanceConfigRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetConnectInstanceConfigResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetInstanceOnboardingJobStatusRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.GetInstanceOnboardingJobStatusResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.InternalServerException;
import software.amazon.awssdk.services.connectcampaignsv2.model.InvalidCampaignStateException;
import software.amazon.awssdk.services.connectcampaignsv2.model.InvalidStateException;
import software.amazon.awssdk.services.connectcampaignsv2.model.ListCampaignsRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.ListCampaignsResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.ListConnectInstanceIntegrationsRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.ListConnectInstanceIntegrationsResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.PauseCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.PauseCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.PutConnectInstanceIntegrationRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.PutConnectInstanceIntegrationResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.PutOutboundRequestBatchRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.PutOutboundRequestBatchResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.ResourceNotFoundException;
import software.amazon.awssdk.services.connectcampaignsv2.model.ResumeCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.ResumeCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.connectcampaignsv2.model.StartCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.StartCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.StartInstanceOnboardingJobRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.StartInstanceOnboardingJobResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.StopCampaignRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.StopCampaignResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.TagResourceRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.TagResourceResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.ThrottlingException;
import software.amazon.awssdk.services.connectcampaignsv2.model.UntagResourceRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UntagResourceResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignChannelSubtypeConfigRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignChannelSubtypeConfigResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignCommunicationLimitsRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignCommunicationLimitsResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignCommunicationTimeRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignCommunicationTimeResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignFlowAssociationRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignFlowAssociationResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignNameRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignNameResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignScheduleRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignScheduleResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignSourceRequest;
import software.amazon.awssdk.services.connectcampaignsv2.model.UpdateCampaignSourceResponse;
import software.amazon.awssdk.services.connectcampaignsv2.model.ValidationException;
import software.amazon.awssdk.services.connectcampaignsv2.transform.CreateCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteCampaignChannelSubtypeConfigRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteCampaignCommunicationLimitsRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteCampaignCommunicationTimeRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteConnectInstanceConfigRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteConnectInstanceIntegrationRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DeleteInstanceOnboardingJobRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.DescribeCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.GetCampaignStateBatchRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.GetCampaignStateRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.GetConnectInstanceConfigRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.GetInstanceOnboardingJobStatusRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.ListCampaignsRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.ListConnectInstanceIntegrationsRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.PauseCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.PutConnectInstanceIntegrationRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.PutOutboundRequestBatchRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.ResumeCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.StartCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.StartInstanceOnboardingJobRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.StopCampaignRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignChannelSubtypeConfigRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignCommunicationLimitsRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignCommunicationTimeRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignFlowAssociationRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignNameRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignScheduleRequestMarshaller;
import software.amazon.awssdk.services.connectcampaignsv2.transform.UpdateCampaignSourceRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

/**
 * Internal implementation of {@link ConnectCampaignsV2Client}.
 *
 * @see ConnectCampaignsV2Client#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultConnectCampaignsV2Client implements ConnectCampaignsV2Client {
    private static final Logger log = Logger.loggerFor(DefaultConnectCampaignsV2Client.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 DefaultConnectCampaignsV2Client(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Creates a campaign for the specified Amazon Connect account. This API is idempotent. *

* * @param createCampaignRequest * The request for CreateCampaign API. * @return Result of the CreateCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ServiceQuotaExceededException * Request would cause a service quota to be exceeded. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.CreateCampaign * @see AWS API Documentation */ @Override public CreateCampaignResponse createCampaign(CreateCampaignRequest createCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, AccessDeniedException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a campaign from the specified Amazon Connect account. *

* * @param deleteCampaignRequest * The request for DeleteCampaign API. * @return Result of the DeleteCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteCampaign * @see AWS API Documentation */ @Override public DeleteCampaignResponse deleteCampaign(DeleteCampaignRequest deleteCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes the channel subtype config of a campaign. This API is idempotent. *

* * @param deleteCampaignChannelSubtypeConfigRequest * The request for DeleteCampaignChannelSubtypeConfig API. * @return Result of the DeleteCampaignChannelSubtypeConfig operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteCampaignChannelSubtypeConfig * @see AWS API Documentation */ @Override public DeleteCampaignChannelSubtypeConfigResponse deleteCampaignChannelSubtypeConfig( DeleteCampaignChannelSubtypeConfigRequest deleteCampaignChannelSubtypeConfigRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCampaignChannelSubtypeConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCampaignChannelSubtypeConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignChannelSubtypeConfigRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaignChannelSubtypeConfig"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCampaignChannelSubtypeConfig").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteCampaignChannelSubtypeConfigRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteCampaignChannelSubtypeConfigRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes the communication limits config for a campaign. This API is idempotent. *

* * @param deleteCampaignCommunicationLimitsRequest * The request for DeleteCampaignCommunicationLimits API. * @return Result of the DeleteCampaignCommunicationLimits operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteCampaignCommunicationLimits * @see AWS API Documentation */ @Override public DeleteCampaignCommunicationLimitsResponse deleteCampaignCommunicationLimits( DeleteCampaignCommunicationLimitsRequest deleteCampaignCommunicationLimitsRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCampaignCommunicationLimitsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCampaignCommunicationLimitsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignCommunicationLimitsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaignCommunicationLimits"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCampaignCommunicationLimits").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteCampaignCommunicationLimitsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteCampaignCommunicationLimitsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes the communication time config for a campaign. This API is idempotent. *

* * @param deleteCampaignCommunicationTimeRequest * The request for DeleteCampaignCommunicationTime API. * @return Result of the DeleteCampaignCommunicationTime operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteCampaignCommunicationTime * @see AWS API Documentation */ @Override public DeleteCampaignCommunicationTimeResponse deleteCampaignCommunicationTime( DeleteCampaignCommunicationTimeRequest deleteCampaignCommunicationTimeRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCampaignCommunicationTimeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCampaignCommunicationTimeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignCommunicationTimeRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaignCommunicationTime"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCampaignCommunicationTime").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteCampaignCommunicationTimeRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteCampaignCommunicationTimeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a connect instance config from the specified AWS account. *

* * @param deleteConnectInstanceConfigRequest * The request for DeleteConnectInstanceConfig API. * @return Result of the DeleteConnectInstanceConfig operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws InvalidStateException * The request could not be processed because of conflict in the current state. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteConnectInstanceConfig * @see AWS API Documentation */ @Override public DeleteConnectInstanceConfigResponse deleteConnectInstanceConfig( DeleteConnectInstanceConfigRequest deleteConnectInstanceConfigRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, InvalidStateException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteConnectInstanceConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectInstanceConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectInstanceConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnectInstanceConfig"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteConnectInstanceConfig").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteConnectInstanceConfigRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteConnectInstanceConfigRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete the integration for the specified Amazon Connect instance. *

* * @param deleteConnectInstanceIntegrationRequest * The request for DeleteConnectInstanceIntegration API. * @return Result of the DeleteConnectInstanceIntegration operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteConnectInstanceIntegration * @see AWS API Documentation */ @Override public DeleteConnectInstanceIntegrationResponse deleteConnectInstanceIntegration( DeleteConnectInstanceIntegrationRequest deleteConnectInstanceIntegrationRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteConnectInstanceIntegrationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConnectInstanceIntegrationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConnectInstanceIntegrationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConnectInstanceIntegration"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteConnectInstanceIntegration").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteConnectInstanceIntegrationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteConnectInstanceIntegrationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete the Connect Campaigns onboarding job for the specified Amazon Connect instance. *

* * @param deleteInstanceOnboardingJobRequest * The request for DeleteInstanceOnboardingJob API. * @return Result of the DeleteInstanceOnboardingJob operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws InvalidStateException * The request could not be processed because of conflict in the current state. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DeleteInstanceOnboardingJob * @see AWS API Documentation */ @Override public DeleteInstanceOnboardingJobResponse deleteInstanceOnboardingJob( DeleteInstanceOnboardingJobRequest deleteInstanceOnboardingJobRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, InvalidStateException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteInstanceOnboardingJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteInstanceOnboardingJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteInstanceOnboardingJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteInstanceOnboardingJob"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteInstanceOnboardingJob").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteInstanceOnboardingJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteInstanceOnboardingJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Describes the specific campaign. *

* * @param describeCampaignRequest * The request for DescribeCampaign API. * @return Result of the DescribeCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.DescribeCampaign * @see AWS API Documentation */ @Override public DescribeCampaignResponse describeCampaign(DescribeCampaignRequest describeCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get state of a campaign for the specified Amazon Connect account. *

* * @param getCampaignStateRequest * The request for GetCampaignState API. * @return Result of the GetCampaignState operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.GetCampaignState * @see AWS API Documentation */ @Override public GetCampaignStateResponse getCampaignState(GetCampaignStateRequest getCampaignStateRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetCampaignStateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCampaignStateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignStateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaignState"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetCampaignState").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getCampaignStateRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetCampaignStateRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get state of campaigns for the specified Amazon Connect account. *

* * @param getCampaignStateBatchRequest * The request for GetCampaignStateBatch API. * @return Result of the GetCampaignStateBatch operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.GetCampaignStateBatch * @see AWS API Documentation */ @Override public GetCampaignStateBatchResponse getCampaignStateBatch(GetCampaignStateBatchRequest getCampaignStateBatchRequest) throws InternalServerException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCampaignStateBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCampaignStateBatchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignStateBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaignStateBatch"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetCampaignStateBatch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getCampaignStateBatchRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetCampaignStateBatchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get the specific Connect instance config. *

* * @param getConnectInstanceConfigRequest * The request for GetConnectInstanceConfig API. * @return Result of the GetConnectInstanceConfig operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.GetConnectInstanceConfig * @see AWS API Documentation */ @Override public GetConnectInstanceConfigResponse getConnectInstanceConfig( GetConnectInstanceConfigRequest getConnectInstanceConfigRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetConnectInstanceConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConnectInstanceConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getConnectInstanceConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConnectInstanceConfig"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetConnectInstanceConfig").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getConnectInstanceConfigRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetConnectInstanceConfigRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get the specific instance onboarding job status. *

* * @param getInstanceOnboardingJobStatusRequest * The request for GetInstanceOnboardingJobStatus API. * @return Result of the GetInstanceOnboardingJobStatus operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.GetInstanceOnboardingJobStatus * @see AWS API Documentation */ @Override public GetInstanceOnboardingJobStatusResponse getInstanceOnboardingJobStatus( GetInstanceOnboardingJobStatusRequest getInstanceOnboardingJobStatusRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetInstanceOnboardingJobStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getInstanceOnboardingJobStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getInstanceOnboardingJobStatusRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetInstanceOnboardingJobStatus"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetInstanceOnboardingJobStatus").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getInstanceOnboardingJobStatusRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetInstanceOnboardingJobStatusRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Provides summary information about the campaigns under the specified Amazon Connect account. *

* * @param listCampaignsRequest * The request for ListCampaigns API. * @return Result of the ListCampaigns operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.ListCampaigns * @see AWS API Documentation */ @Override public ListCampaignsResponse listCampaigns(ListCampaignsRequest listCampaignsRequest) throws InternalServerException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListCampaignsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCampaignsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCampaignsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCampaigns"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListCampaigns").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listCampaignsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListCampaignsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Provides summary information about the integration under the specified Connect instance. *

* * @param listConnectInstanceIntegrationsRequest * The request for ListConnectInstanceIntegrations API. * @return Result of the ListConnectInstanceIntegrations operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.ListConnectInstanceIntegrations * @see AWS API Documentation */ @Override public ListConnectInstanceIntegrationsResponse listConnectInstanceIntegrations( ListConnectInstanceIntegrationsRequest listConnectInstanceIntegrationsRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListConnectInstanceIntegrationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConnectInstanceIntegrationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listConnectInstanceIntegrationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConnectInstanceIntegrations"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListConnectInstanceIntegrations").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listConnectInstanceIntegrationsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListConnectInstanceIntegrationsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List tags for a resource. *

* * @param listTagsForResourceRequest * The request for ListTagsForResource API. * @return Result of the ListTagsForResource operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { 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, "ConnectCampaignsV2"); 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())); } } /** *

* Pauses a campaign for the specified Amazon Connect account. *

* * @param pauseCampaignRequest * The request for PauseCampaign API. * @return Result of the PauseCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.PauseCampaign * @see AWS API Documentation */ @Override public PauseCampaignResponse pauseCampaign(PauseCampaignRequest pauseCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PauseCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(pauseCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, pauseCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PauseCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("PauseCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(pauseCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PauseCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Put or update the integration for the specified Amazon Connect instance. *

* * @param putConnectInstanceIntegrationRequest * The request for PutConnectInstanceIntegration API. * @return Result of the PutConnectInstanceIntegration operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.PutConnectInstanceIntegration * @see AWS API Documentation */ @Override public PutConnectInstanceIntegrationResponse putConnectInstanceIntegration( PutConnectInstanceIntegrationRequest putConnectInstanceIntegrationRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutConnectInstanceIntegrationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putConnectInstanceIntegrationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putConnectInstanceIntegrationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutConnectInstanceIntegration"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("PutConnectInstanceIntegration").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putConnectInstanceIntegrationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutConnectInstanceIntegrationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates outbound requests for the specified campaign Amazon Connect account. This API is idempotent. *

* * @param putOutboundRequestBatchRequest * The request for PutOutboundRequestBatch API. * @return Result of the PutOutboundRequestBatch operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.PutOutboundRequestBatch * @see AWS API Documentation */ @Override public PutOutboundRequestBatchResponse putOutboundRequestBatch(PutOutboundRequestBatchRequest putOutboundRequestBatchRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutOutboundRequestBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putOutboundRequestBatchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putOutboundRequestBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutOutboundRequestBatch"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("PutOutboundRequestBatch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putOutboundRequestBatchRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutOutboundRequestBatchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stops a campaign for the specified Amazon Connect account. *

* * @param resumeCampaignRequest * The request for ResumeCampaign API. * @return Result of the ResumeCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.ResumeCampaign * @see AWS API Documentation */ @Override public ResumeCampaignResponse resumeCampaign(ResumeCampaignRequest resumeCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ResumeCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(resumeCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, resumeCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ResumeCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ResumeCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(resumeCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ResumeCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts a campaign for the specified Amazon Connect account. *

* * @param startCampaignRequest * The request for StartCampaign API. * @return Result of the StartCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.StartCampaign * @see AWS API Documentation */ @Override public StartCampaignResponse startCampaign(StartCampaignRequest startCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Onboard the specific Amazon Connect instance to Connect Campaigns. *

* * @param startInstanceOnboardingJobRequest * The request for StartInstanceOnboardingJob API. * @return Result of the StartInstanceOnboardingJob operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.StartInstanceOnboardingJob * @see AWS API Documentation */ @Override public StartInstanceOnboardingJobResponse startInstanceOnboardingJob( StartInstanceOnboardingJobRequest startInstanceOnboardingJobRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartInstanceOnboardingJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startInstanceOnboardingJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startInstanceOnboardingJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartInstanceOnboardingJob"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("StartInstanceOnboardingJob").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startInstanceOnboardingJobRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartInstanceOnboardingJobRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stops a campaign for the specified Amazon Connect account. *

* * @param stopCampaignRequest * The request for StopCampaign API. * @return Result of the StopCampaign operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.StopCampaign * @see AWS API Documentation */ @Override public StopCampaignResponse stopCampaign(StopCampaignRequest stopCampaignRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopCampaignResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopCampaignRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopCampaignRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopCampaign"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StopCampaign").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(stopCampaignRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopCampaignRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Tag a resource. *

* * @param tagResourceRequest * The request for TagResource API. * @return Result of the TagResource operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.TagResource * @see AWS API Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { 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, "ConnectCampaignsV2"); 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())); } } /** *

* Untag a resource. *

* * @param untagResourceRequest * The request for UntagResource API. * @return Result of the UntagResource operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @throws ThrottlingException * The request was denied due to request throttling. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UntagResource * @see AWS API Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { 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, "ConnectCampaignsV2"); 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 the channel subtype config of a campaign. This API is idempotent. *

* * @param updateCampaignChannelSubtypeConfigRequest * The request for UpdateCampaignChannelSubtypeConfig API. * @return Result of the UpdateCampaignChannelSubtypeConfig operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignChannelSubtypeConfig * @see AWS API Documentation */ @Override public UpdateCampaignChannelSubtypeConfigResponse updateCampaignChannelSubtypeConfig( UpdateCampaignChannelSubtypeConfigRequest updateCampaignChannelSubtypeConfigRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignChannelSubtypeConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignChannelSubtypeConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignChannelSubtypeConfigRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignChannelSubtypeConfig"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaignChannelSubtypeConfig").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignChannelSubtypeConfigRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignChannelSubtypeConfigRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the communication limits config for a campaign. This API is idempotent. *

* * @param updateCampaignCommunicationLimitsRequest * The request for UpdateCampaignCommunicationLimits API. * @return Result of the UpdateCampaignCommunicationLimits operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignCommunicationLimits * @see AWS API Documentation */ @Override public UpdateCampaignCommunicationLimitsResponse updateCampaignCommunicationLimits( UpdateCampaignCommunicationLimitsRequest updateCampaignCommunicationLimitsRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignCommunicationLimitsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignCommunicationLimitsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignCommunicationLimitsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignCommunicationLimits"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaignCommunicationLimits").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignCommunicationLimitsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignCommunicationLimitsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the communication time config for a campaign. This API is idempotent. *

* * @param updateCampaignCommunicationTimeRequest * The request for UpdateCampaignCommunicationTime API. * @return Result of the UpdateCampaignCommunicationTime operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignCommunicationTime * @see AWS API Documentation */ @Override public UpdateCampaignCommunicationTimeResponse updateCampaignCommunicationTime( UpdateCampaignCommunicationTimeRequest updateCampaignCommunicationTimeRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignCommunicationTimeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignCommunicationTimeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignCommunicationTimeRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignCommunicationTime"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaignCommunicationTime").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignCommunicationTimeRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignCommunicationTimeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the campaign flow associated with a campaign. This API is idempotent. *

* * @param updateCampaignFlowAssociationRequest * The request for UpdateCampaignFlowAssociation API. * @return Result of the UpdateCampaignFlowAssociation operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignFlowAssociation * @see AWS API Documentation */ @Override public UpdateCampaignFlowAssociationResponse updateCampaignFlowAssociation( UpdateCampaignFlowAssociationRequest updateCampaignFlowAssociationRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignFlowAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignFlowAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignFlowAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignFlowAssociation"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaignFlowAssociation").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignFlowAssociationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignFlowAssociationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the name of a campaign. This API is idempotent. *

* * @param updateCampaignNameRequest * The request for UpdateCampaignName API. * @return Result of the UpdateCampaignName operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignName * @see AWS API Documentation */ @Override public UpdateCampaignNameResponse updateCampaignName(UpdateCampaignNameRequest updateCampaignNameRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignNameResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignNameRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignNameRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignName"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateCampaignName").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignNameRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignNameRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the schedule for a campaign. This API is idempotent. *

* * @param updateCampaignScheduleRequest * The request for UpdateCampaignSchedule API. * @return Result of the UpdateCampaignSchedule operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignSchedule * @see AWS API Documentation */ @Override public UpdateCampaignScheduleResponse updateCampaignSchedule(UpdateCampaignScheduleRequest updateCampaignScheduleRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignScheduleResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignScheduleRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignScheduleRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignSchedule"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCampaignSchedule").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignScheduleRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignScheduleRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the campaign source with a campaign. This API is idempotent. *

* * @param updateCampaignSourceRequest * The request for UpdateCampaignSource API. * @return Result of the UpdateCampaignSource operation returned by the service. * @throws InternalServerException * Request processing failed because of an error or failure with the service. * @throws ResourceNotFoundException * The specified resource was not found. * @throws ValidationException * The input fails to satisfy the constraints specified by an AWS service. * @throws ConflictException * The request could not be processed because of conflict in the current state of the resource. * @throws InvalidCampaignStateException * The request could not be processed because of conflict in the current state of the campaign. * @throws AccessDeniedException * You do not have sufficient access to perform this action. * @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 ConnectCampaignsV2Exception * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample ConnectCampaignsV2Client.UpdateCampaignSource * @see AWS API Documentation */ @Override public UpdateCampaignSourceResponse updateCampaignSource(UpdateCampaignSourceRequest updateCampaignSourceRequest) throws InternalServerException, ResourceNotFoundException, ValidationException, ConflictException, InvalidCampaignStateException, AccessDeniedException, AwsServiceException, SdkClientException, ConnectCampaignsV2Exception { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCampaignSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCampaignSourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCampaignSourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "ConnectCampaignsV2"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCampaignSource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateCampaignSource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateCampaignSourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateCampaignSourceRequestMarshaller(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(); } ConnectCampaignsV2ServiceClientConfigurationBuilder serviceConfigBuilder = new ConnectCampaignsV2ServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(ConnectCampaignsV2Exception::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidCampaignStateException") .exceptionBuilderSupplier(InvalidCampaignStateException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidStateException") .exceptionBuilderSupplier(InvalidStateException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()); } @Override public final ConnectCampaignsV2ServiceClientConfiguration serviceClientConfiguration() { return new ConnectCampaignsV2ServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy