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

software.amazon.awssdk.services.appsync.DefaultAppSyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon AppSync module holds the client classes that are used for communicating with Amazon AppSync.

There is a newer version: 2.29.15
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.appsync;

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.appsync.internal.AppSyncServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.appsync.model.AccessDeniedException;
import software.amazon.awssdk.services.appsync.model.ApiKeyLimitExceededException;
import software.amazon.awssdk.services.appsync.model.ApiKeyValidityOutOfBoundsException;
import software.amazon.awssdk.services.appsync.model.ApiLimitExceededException;
import software.amazon.awssdk.services.appsync.model.AppSyncException;
import software.amazon.awssdk.services.appsync.model.AssociateApiRequest;
import software.amazon.awssdk.services.appsync.model.AssociateApiResponse;
import software.amazon.awssdk.services.appsync.model.AssociateMergedGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.AssociateMergedGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.AssociateSourceGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.AssociateSourceGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.BadRequestException;
import software.amazon.awssdk.services.appsync.model.ConcurrentModificationException;
import software.amazon.awssdk.services.appsync.model.CreateApiCacheRequest;
import software.amazon.awssdk.services.appsync.model.CreateApiCacheResponse;
import software.amazon.awssdk.services.appsync.model.CreateApiKeyRequest;
import software.amazon.awssdk.services.appsync.model.CreateApiKeyResponse;
import software.amazon.awssdk.services.appsync.model.CreateDataSourceRequest;
import software.amazon.awssdk.services.appsync.model.CreateDataSourceResponse;
import software.amazon.awssdk.services.appsync.model.CreateDomainNameRequest;
import software.amazon.awssdk.services.appsync.model.CreateDomainNameResponse;
import software.amazon.awssdk.services.appsync.model.CreateFunctionRequest;
import software.amazon.awssdk.services.appsync.model.CreateFunctionResponse;
import software.amazon.awssdk.services.appsync.model.CreateGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.CreateGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.CreateResolverRequest;
import software.amazon.awssdk.services.appsync.model.CreateResolverResponse;
import software.amazon.awssdk.services.appsync.model.CreateTypeRequest;
import software.amazon.awssdk.services.appsync.model.CreateTypeResponse;
import software.amazon.awssdk.services.appsync.model.DeleteApiCacheRequest;
import software.amazon.awssdk.services.appsync.model.DeleteApiCacheResponse;
import software.amazon.awssdk.services.appsync.model.DeleteApiKeyRequest;
import software.amazon.awssdk.services.appsync.model.DeleteApiKeyResponse;
import software.amazon.awssdk.services.appsync.model.DeleteDataSourceRequest;
import software.amazon.awssdk.services.appsync.model.DeleteDataSourceResponse;
import software.amazon.awssdk.services.appsync.model.DeleteDomainNameRequest;
import software.amazon.awssdk.services.appsync.model.DeleteDomainNameResponse;
import software.amazon.awssdk.services.appsync.model.DeleteFunctionRequest;
import software.amazon.awssdk.services.appsync.model.DeleteFunctionResponse;
import software.amazon.awssdk.services.appsync.model.DeleteGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.DeleteGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.DeleteResolverRequest;
import software.amazon.awssdk.services.appsync.model.DeleteResolverResponse;
import software.amazon.awssdk.services.appsync.model.DeleteTypeRequest;
import software.amazon.awssdk.services.appsync.model.DeleteTypeResponse;
import software.amazon.awssdk.services.appsync.model.DisassociateApiRequest;
import software.amazon.awssdk.services.appsync.model.DisassociateApiResponse;
import software.amazon.awssdk.services.appsync.model.DisassociateMergedGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.DisassociateMergedGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.DisassociateSourceGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.DisassociateSourceGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.EvaluateCodeRequest;
import software.amazon.awssdk.services.appsync.model.EvaluateCodeResponse;
import software.amazon.awssdk.services.appsync.model.EvaluateMappingTemplateRequest;
import software.amazon.awssdk.services.appsync.model.EvaluateMappingTemplateResponse;
import software.amazon.awssdk.services.appsync.model.FlushApiCacheRequest;
import software.amazon.awssdk.services.appsync.model.FlushApiCacheResponse;
import software.amazon.awssdk.services.appsync.model.GetApiAssociationRequest;
import software.amazon.awssdk.services.appsync.model.GetApiAssociationResponse;
import software.amazon.awssdk.services.appsync.model.GetApiCacheRequest;
import software.amazon.awssdk.services.appsync.model.GetApiCacheResponse;
import software.amazon.awssdk.services.appsync.model.GetDataSourceIntrospectionRequest;
import software.amazon.awssdk.services.appsync.model.GetDataSourceIntrospectionResponse;
import software.amazon.awssdk.services.appsync.model.GetDataSourceRequest;
import software.amazon.awssdk.services.appsync.model.GetDataSourceResponse;
import software.amazon.awssdk.services.appsync.model.GetDomainNameRequest;
import software.amazon.awssdk.services.appsync.model.GetDomainNameResponse;
import software.amazon.awssdk.services.appsync.model.GetFunctionRequest;
import software.amazon.awssdk.services.appsync.model.GetFunctionResponse;
import software.amazon.awssdk.services.appsync.model.GetGraphqlApiEnvironmentVariablesRequest;
import software.amazon.awssdk.services.appsync.model.GetGraphqlApiEnvironmentVariablesResponse;
import software.amazon.awssdk.services.appsync.model.GetGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.GetGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.GetIntrospectionSchemaRequest;
import software.amazon.awssdk.services.appsync.model.GetIntrospectionSchemaResponse;
import software.amazon.awssdk.services.appsync.model.GetResolverRequest;
import software.amazon.awssdk.services.appsync.model.GetResolverResponse;
import software.amazon.awssdk.services.appsync.model.GetSchemaCreationStatusRequest;
import software.amazon.awssdk.services.appsync.model.GetSchemaCreationStatusResponse;
import software.amazon.awssdk.services.appsync.model.GetSourceApiAssociationRequest;
import software.amazon.awssdk.services.appsync.model.GetSourceApiAssociationResponse;
import software.amazon.awssdk.services.appsync.model.GetTypeRequest;
import software.amazon.awssdk.services.appsync.model.GetTypeResponse;
import software.amazon.awssdk.services.appsync.model.GraphQlSchemaException;
import software.amazon.awssdk.services.appsync.model.InternalFailureException;
import software.amazon.awssdk.services.appsync.model.LimitExceededException;
import software.amazon.awssdk.services.appsync.model.ListApiKeysRequest;
import software.amazon.awssdk.services.appsync.model.ListApiKeysResponse;
import software.amazon.awssdk.services.appsync.model.ListDataSourcesRequest;
import software.amazon.awssdk.services.appsync.model.ListDataSourcesResponse;
import software.amazon.awssdk.services.appsync.model.ListDomainNamesRequest;
import software.amazon.awssdk.services.appsync.model.ListDomainNamesResponse;
import software.amazon.awssdk.services.appsync.model.ListFunctionsRequest;
import software.amazon.awssdk.services.appsync.model.ListFunctionsResponse;
import software.amazon.awssdk.services.appsync.model.ListGraphqlApisRequest;
import software.amazon.awssdk.services.appsync.model.ListGraphqlApisResponse;
import software.amazon.awssdk.services.appsync.model.ListResolversByFunctionRequest;
import software.amazon.awssdk.services.appsync.model.ListResolversByFunctionResponse;
import software.amazon.awssdk.services.appsync.model.ListResolversRequest;
import software.amazon.awssdk.services.appsync.model.ListResolversResponse;
import software.amazon.awssdk.services.appsync.model.ListSourceApiAssociationsRequest;
import software.amazon.awssdk.services.appsync.model.ListSourceApiAssociationsResponse;
import software.amazon.awssdk.services.appsync.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.appsync.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.appsync.model.ListTypesByAssociationRequest;
import software.amazon.awssdk.services.appsync.model.ListTypesByAssociationResponse;
import software.amazon.awssdk.services.appsync.model.ListTypesRequest;
import software.amazon.awssdk.services.appsync.model.ListTypesResponse;
import software.amazon.awssdk.services.appsync.model.NotFoundException;
import software.amazon.awssdk.services.appsync.model.PutGraphqlApiEnvironmentVariablesRequest;
import software.amazon.awssdk.services.appsync.model.PutGraphqlApiEnvironmentVariablesResponse;
import software.amazon.awssdk.services.appsync.model.StartDataSourceIntrospectionRequest;
import software.amazon.awssdk.services.appsync.model.StartDataSourceIntrospectionResponse;
import software.amazon.awssdk.services.appsync.model.StartSchemaCreationRequest;
import software.amazon.awssdk.services.appsync.model.StartSchemaCreationResponse;
import software.amazon.awssdk.services.appsync.model.StartSchemaMergeRequest;
import software.amazon.awssdk.services.appsync.model.StartSchemaMergeResponse;
import software.amazon.awssdk.services.appsync.model.TagResourceRequest;
import software.amazon.awssdk.services.appsync.model.TagResourceResponse;
import software.amazon.awssdk.services.appsync.model.UnauthorizedException;
import software.amazon.awssdk.services.appsync.model.UntagResourceRequest;
import software.amazon.awssdk.services.appsync.model.UntagResourceResponse;
import software.amazon.awssdk.services.appsync.model.UpdateApiCacheRequest;
import software.amazon.awssdk.services.appsync.model.UpdateApiCacheResponse;
import software.amazon.awssdk.services.appsync.model.UpdateApiKeyRequest;
import software.amazon.awssdk.services.appsync.model.UpdateApiKeyResponse;
import software.amazon.awssdk.services.appsync.model.UpdateDataSourceRequest;
import software.amazon.awssdk.services.appsync.model.UpdateDataSourceResponse;
import software.amazon.awssdk.services.appsync.model.UpdateDomainNameRequest;
import software.amazon.awssdk.services.appsync.model.UpdateDomainNameResponse;
import software.amazon.awssdk.services.appsync.model.UpdateFunctionRequest;
import software.amazon.awssdk.services.appsync.model.UpdateFunctionResponse;
import software.amazon.awssdk.services.appsync.model.UpdateGraphqlApiRequest;
import software.amazon.awssdk.services.appsync.model.UpdateGraphqlApiResponse;
import software.amazon.awssdk.services.appsync.model.UpdateResolverRequest;
import software.amazon.awssdk.services.appsync.model.UpdateResolverResponse;
import software.amazon.awssdk.services.appsync.model.UpdateSourceApiAssociationRequest;
import software.amazon.awssdk.services.appsync.model.UpdateSourceApiAssociationResponse;
import software.amazon.awssdk.services.appsync.model.UpdateTypeRequest;
import software.amazon.awssdk.services.appsync.model.UpdateTypeResponse;
import software.amazon.awssdk.services.appsync.transform.AssociateApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.AssociateMergedGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.AssociateSourceGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateApiCacheRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateApiKeyRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateDataSourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateDomainNameRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateFunctionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateResolverRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.CreateTypeRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteApiCacheRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteApiKeyRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteDataSourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteDomainNameRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteFunctionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteResolverRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DeleteTypeRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DisassociateApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DisassociateMergedGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.DisassociateSourceGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.EvaluateCodeRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.EvaluateMappingTemplateRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.FlushApiCacheRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetApiAssociationRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetApiCacheRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetDataSourceIntrospectionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetDataSourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetDomainNameRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetFunctionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetGraphqlApiEnvironmentVariablesRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetIntrospectionSchemaRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetResolverRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetSchemaCreationStatusRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetSourceApiAssociationRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.GetTypeRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListApiKeysRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListDataSourcesRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListDomainNamesRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListFunctionsRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListGraphqlApisRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListResolversByFunctionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListResolversRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListSourceApiAssociationsRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListTypesByAssociationRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.ListTypesRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.PutGraphqlApiEnvironmentVariablesRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.StartDataSourceIntrospectionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.StartSchemaCreationRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.StartSchemaMergeRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateApiCacheRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateApiKeyRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateDataSourceRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateDomainNameRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateFunctionRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateGraphqlApiRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateResolverRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateSourceApiAssociationRequestMarshaller;
import software.amazon.awssdk.services.appsync.transform.UpdateTypeRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

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

    /**
     * 

* Maps an endpoint to your custom domain. *

* * @param associateApiRequest * @return Result of the AssociateApi operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.AssociateApi * @see AWS API * Documentation */ @Override public AssociateApiResponse associateApi(AssociateApiRequest associateApiRequest) throws AccessDeniedException, BadRequestException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, AssociateApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateApi"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("AssociateApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(associateApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new AssociateApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates an association between a Merged API and source API using the source API's identifier. *

* * @param associateMergedGraphqlApiRequest * @return Result of the AssociateMergedGraphqlApi operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.AssociateMergedGraphqlApi * @see AWS API Documentation */ @Override public AssociateMergedGraphqlApiResponse associateMergedGraphqlApi( AssociateMergedGraphqlApiRequest associateMergedGraphqlApiRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, LimitExceededException, ConcurrentModificationException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateMergedGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateMergedGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateMergedGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateMergedGraphqlApi"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateMergedGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(associateMergedGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new AssociateMergedGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates an association between a Merged API and source API using the Merged API's identifier. *

* * @param associateSourceGraphqlApiRequest * @return Result of the AssociateSourceGraphqlApi operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.AssociateSourceGraphqlApi * @see AWS API Documentation */ @Override public AssociateSourceGraphqlApiResponse associateSourceGraphqlApi( AssociateSourceGraphqlApiRequest associateSourceGraphqlApiRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, LimitExceededException, ConcurrentModificationException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateSourceGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateSourceGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateSourceGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateSourceGraphqlApi"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateSourceGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(associateSourceGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new AssociateSourceGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a cache for the GraphQL API. *

* * @param createApiCacheRequest * Represents the input of a CreateApiCache operation. * @return Result of the CreateApiCache operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateApiCache * @see AWS API * Documentation */ @Override public CreateApiCacheResponse createApiCache(CreateApiCacheRequest createApiCacheRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateApiCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createApiCacheRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createApiCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApiCache"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateApiCache").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createApiCacheRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateApiCacheRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a unique key that you can distribute to clients who invoke your API. *

* * @param createApiKeyRequest * @return Result of the CreateApiKey operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws ApiKeyLimitExceededException * The API key exceeded a limit. Try your request again. * @throws ApiKeyValidityOutOfBoundsException * The API key expiration must be set to a value between 1 and 365 days from creation (for * CreateApiKey) or from update (for UpdateApiKey). * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateApiKey * @see AWS API * Documentation */ @Override public CreateApiKeyResponse createApiKey(CreateApiKeyRequest createApiKeyRequest) throws BadRequestException, NotFoundException, LimitExceededException, UnauthorizedException, InternalFailureException, ApiKeyLimitExceededException, ApiKeyValidityOutOfBoundsException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateApiKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createApiKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createApiKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApiKey"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateApiKey").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createApiKeyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateApiKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a DataSource object. *

* * @param createDataSourceRequest * @return Result of the CreateDataSource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateDataSource * @see AWS API * Documentation */ @Override public CreateDataSourceResponse createDataSource(CreateDataSourceRequest createDataSourceRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataSourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataSourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataSource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDataSource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createDataSourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDataSourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a custom DomainName object. *

* * @param createDomainNameRequest * @return Result of the CreateDomainName operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateDomainName * @see AWS API * Documentation */ @Override public CreateDomainNameResponse createDomainName(CreateDomainNameRequest createDomainNameRequest) throws AccessDeniedException, BadRequestException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDomainNameResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDomainNameRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDomainNameRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDomainName"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDomainName").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createDomainNameRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDomainNameRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a Function object. *

*

* A function is a reusable entity. You can use multiple functions to compose the resolver logic. *

* * @param createFunctionRequest * @return Result of the CreateFunction operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateFunction * @see AWS API * Documentation */ @Override public CreateFunctionResponse createFunction(CreateFunctionRequest createFunctionRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFunctionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createFunctionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFunction"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateFunction").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createFunctionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateFunctionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a GraphqlApi object. *

* * @param createGraphqlApiRequest * @return Result of the CreateGraphqlApi operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws ApiLimitExceededException * The GraphQL API exceeded a limit. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateGraphqlApi * @see AWS API * Documentation */ @Override public CreateGraphqlApiResponse createGraphqlApi(CreateGraphqlApiRequest createGraphqlApiRequest) throws BadRequestException, LimitExceededException, ConcurrentModificationException, UnauthorizedException, InternalFailureException, ApiLimitExceededException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateGraphqlApi"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a Resolver object. *

*

* A resolver converts incoming requests into a format that a data source can understand, and converts the data * source's responses into GraphQL. *

* * @param createResolverRequest * @return Result of the CreateResolver operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateResolver * @see AWS API * Documentation */ @Override public CreateResolverResponse createResolver(CreateResolverRequest createResolverRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateResolverResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createResolverRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createResolverRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateResolver"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateResolver").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createResolverRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateResolverRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a Type object. *

* * @param createTypeRequest * @return Result of the CreateType operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.CreateType * @see AWS API * Documentation */ @Override public CreateTypeResponse createType(CreateTypeRequest createTypeRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createTypeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateType"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateType").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(createTypeRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateTypeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an ApiCache object. *

* * @param deleteApiCacheRequest * Represents the input of a DeleteApiCache operation. * @return Result of the DeleteApiCache operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteApiCache * @see AWS API * Documentation */ @Override public DeleteApiCacheResponse deleteApiCache(DeleteApiCacheRequest deleteApiCacheRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteApiCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteApiCacheRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApiCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApiCache"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteApiCache").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteApiCacheRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteApiCacheRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an API key. *

* * @param deleteApiKeyRequest * @return Result of the DeleteApiKey operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteApiKey * @see AWS API * Documentation */ @Override public DeleteApiKeyResponse deleteApiKey(DeleteApiKeyRequest deleteApiKeyRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteApiKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteApiKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApiKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApiKey"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteApiKey").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteApiKeyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteApiKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a DataSource object. *

* * @param deleteDataSourceRequest * @return Result of the DeleteDataSource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteDataSource * @see AWS API * Documentation */ @Override public DeleteDataSourceResponse deleteDataSource(DeleteDataSourceRequest deleteDataSourceRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDataSourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDataSourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataSource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteDataSource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteDataSourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteDataSourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a custom DomainName object. *

* * @param deleteDomainNameRequest * @return Result of the DeleteDomainName operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteDomainName * @see AWS API * Documentation */ @Override public DeleteDomainNameResponse deleteDomainName(DeleteDomainNameRequest deleteDomainNameRequest) throws AccessDeniedException, BadRequestException, ConcurrentModificationException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDomainNameResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDomainNameRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDomainNameRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDomainName"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteDomainName").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteDomainNameRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteDomainNameRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a Function. *

* * @param deleteFunctionRequest * @return Result of the DeleteFunction operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteFunction * @see AWS API * Documentation */ @Override public DeleteFunctionResponse deleteFunction(DeleteFunctionRequest deleteFunctionRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFunctionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFunctionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFunction"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteFunction").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteFunctionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteFunctionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a GraphqlApi object. *

* * @param deleteGraphqlApiRequest * @return Result of the DeleteGraphqlApi operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteGraphqlApi * @see AWS API * Documentation */ @Override public DeleteGraphqlApiResponse deleteGraphqlApi(DeleteGraphqlApiRequest deleteGraphqlApiRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteGraphqlApi"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a Resolver object. *

* * @param deleteResolverRequest * @return Result of the DeleteResolver operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteResolver * @see AWS API * Documentation */ @Override public DeleteResolverResponse deleteResolver(DeleteResolverRequest deleteResolverRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteResolverResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResolverRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResolverRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResolver"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteResolver").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteResolverRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteResolverRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a Type object. *

* * @param deleteTypeRequest * @return Result of the DeleteType operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DeleteType * @see AWS API * Documentation */ @Override public DeleteTypeResponse deleteType(DeleteTypeRequest deleteTypeRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteTypeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteType"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteType").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(deleteTypeRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteTypeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Removes an ApiAssociation object from a custom domain. *

* * @param disassociateApiRequest * @return Result of the DisassociateApi operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DisassociateApi * @see AWS API * Documentation */ @Override public DisassociateApiResponse disassociateApi(DisassociateApiRequest disassociateApiRequest) throws AccessDeniedException, BadRequestException, ConcurrentModificationException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DisassociateApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateApi"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DisassociateApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(disassociateApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DisassociateApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an association between a Merged API and source API using the source API's identifier and the association * ID. *

* * @param disassociateMergedGraphqlApiRequest * @return Result of the DisassociateMergedGraphqlApi operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DisassociateMergedGraphqlApi * @see AWS API Documentation */ @Override public DisassociateMergedGraphqlApiResponse disassociateMergedGraphqlApi( DisassociateMergedGraphqlApiRequest disassociateMergedGraphqlApiRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, ConcurrentModificationException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateMergedGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateMergedGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateMergedGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateMergedGraphqlApi"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateMergedGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(disassociateMergedGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DisassociateMergedGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes an association between a Merged API and source API using the Merged API's identifier and the association * ID. *

* * @param disassociateSourceGraphqlApiRequest * @return Result of the DisassociateSourceGraphqlApi operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.DisassociateSourceGraphqlApi * @see AWS API Documentation */ @Override public DisassociateSourceGraphqlApiResponse disassociateSourceGraphqlApi( DisassociateSourceGraphqlApiRequest disassociateSourceGraphqlApiRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, ConcurrentModificationException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateSourceGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateSourceGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateSourceGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateSourceGraphqlApi"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateSourceGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(disassociateSourceGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DisassociateSourceGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Evaluates the given code and returns the response. The code definition requirements depend on the specified * runtime. For APPSYNC_JS runtimes, the code defines the request and response functions. The request * function takes the incoming request after a GraphQL operation is parsed and converts it into a request * configuration for the selected data source operation. The response function interprets responses from the data * source and maps it to the shape of the GraphQL field output type. *

* * @param evaluateCodeRequest * @return Result of the EvaluateCode operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.EvaluateCode * @see AWS API * Documentation */ @Override public EvaluateCodeResponse evaluateCode(EvaluateCodeRequest evaluateCodeRequest) throws AccessDeniedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, EvaluateCodeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(evaluateCodeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, evaluateCodeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "EvaluateCode"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("EvaluateCode").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(evaluateCodeRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new EvaluateCodeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Evaluates a given template and returns the response. The mapping template can be a request or response template. *

*

* Request templates take the incoming request after a GraphQL operation is parsed and convert it into a request * configuration for the selected data source operation. Response templates interpret responses from the data source * and map it to the shape of the GraphQL field output type. *

*

* Mapping templates are written in the Apache Velocity Template Language (VTL). *

* * @param evaluateMappingTemplateRequest * @return Result of the EvaluateMappingTemplate operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.EvaluateMappingTemplate * @see AWS API Documentation */ @Override public EvaluateMappingTemplateResponse evaluateMappingTemplate(EvaluateMappingTemplateRequest evaluateMappingTemplateRequest) throws AccessDeniedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, EvaluateMappingTemplateResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(evaluateMappingTemplateRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, evaluateMappingTemplateRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "EvaluateMappingTemplate"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("EvaluateMappingTemplate").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(evaluateMappingTemplateRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new EvaluateMappingTemplateRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Flushes an ApiCache object. *

* * @param flushApiCacheRequest * Represents the input of a FlushApiCache operation. * @return Result of the FlushApiCache operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.FlushApiCache * @see AWS API * Documentation */ @Override public FlushApiCacheResponse flushApiCache(FlushApiCacheRequest flushApiCacheRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, FlushApiCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(flushApiCacheRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, flushApiCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "FlushApiCache"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("FlushApiCache").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(flushApiCacheRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new FlushApiCacheRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves an ApiAssociation object. *

* * @param getApiAssociationRequest * @return Result of the GetApiAssociation operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetApiAssociation * @see AWS API * Documentation */ @Override public GetApiAssociationResponse getApiAssociation(GetApiAssociationRequest getApiAssociationRequest) throws AccessDeniedException, BadRequestException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetApiAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getApiAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getApiAssociationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApiAssociation"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetApiAssociation").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getApiAssociationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetApiAssociationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves an ApiCache object. *

* * @param getApiCacheRequest * Represents the input of a GetApiCache operation. * @return Result of the GetApiCache operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetApiCache * @see AWS API * Documentation */ @Override public GetApiCacheResponse getApiCache(GetApiCacheRequest getApiCacheRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetApiCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getApiCacheRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getApiCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApiCache"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetApiCache").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(getApiCacheRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetApiCacheRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a DataSource object. *

* * @param getDataSourceRequest * @return Result of the GetDataSource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetDataSource * @see AWS API * Documentation */ @Override public GetDataSourceResponse getDataSource(GetDataSourceRequest getDataSourceRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataSourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDataSourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataSource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDataSource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDataSourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDataSourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the record of an existing introspection. If the retrieval is successful, the result of the * instrospection will also be returned. If the retrieval fails the operation, an error message will be returned * instead. *

* * @param getDataSourceIntrospectionRequest * @return Result of the GetDataSourceIntrospection operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetDataSourceIntrospection * @see AWS API Documentation */ @Override public GetDataSourceIntrospectionResponse getDataSourceIntrospection( GetDataSourceIntrospectionRequest getDataSourceIntrospectionRequest) throws BadRequestException, NotFoundException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetDataSourceIntrospectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataSourceIntrospectionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDataSourceIntrospectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataSourceIntrospection"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetDataSourceIntrospection").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDataSourceIntrospectionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDataSourceIntrospectionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a custom DomainName object. *

* * @param getDomainNameRequest * @return Result of the GetDomainName operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetDomainName * @see AWS API * Documentation */ @Override public GetDomainNameResponse getDomainName(GetDomainNameRequest getDomainNameRequest) throws AccessDeniedException, BadRequestException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDomainNameResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDomainNameRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDomainNameRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDomainName"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDomainName").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDomainNameRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDomainNameRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get a Function. *

* * @param getFunctionRequest * @return Result of the GetFunction operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetFunction * @see AWS API * Documentation */ @Override public GetFunctionResponse getFunction(GetFunctionRequest getFunctionRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getFunctionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getFunctionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFunction"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetFunction").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(getFunctionRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetFunctionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a GraphqlApi object. *

* * @param getGraphqlApiRequest * @return Result of the GetGraphqlApi operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetGraphqlApi * @see AWS API * Documentation */ @Override public GetGraphqlApiResponse getGraphqlApi(GetGraphqlApiRequest getGraphqlApiRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetGraphqlApi"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the list of environmental variable key-value pairs associated with an API by its ID value. *

* * @param getGraphqlApiEnvironmentVariablesRequest * @return Result of the GetGraphqlApiEnvironmentVariables operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetGraphqlApiEnvironmentVariables * @see AWS API Documentation */ @Override public GetGraphqlApiEnvironmentVariablesResponse getGraphqlApiEnvironmentVariables( GetGraphqlApiEnvironmentVariablesRequest getGraphqlApiEnvironmentVariablesRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetGraphqlApiEnvironmentVariablesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getGraphqlApiEnvironmentVariablesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getGraphqlApiEnvironmentVariablesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetGraphqlApiEnvironmentVariables"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetGraphqlApiEnvironmentVariables").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getGraphqlApiEnvironmentVariablesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetGraphqlApiEnvironmentVariablesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the introspection schema for a GraphQL API. *

* * @param getIntrospectionSchemaRequest * @return Result of the GetIntrospectionSchema operation returned by the service. * @throws GraphQlSchemaException * The GraphQL schema is not valid. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetIntrospectionSchema * @see AWS API Documentation */ @Override public GetIntrospectionSchemaResponse getIntrospectionSchema(GetIntrospectionSchemaRequest getIntrospectionSchemaRequest) throws GraphQlSchemaException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetIntrospectionSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getIntrospectionSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getIntrospectionSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIntrospectionSchema"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetIntrospectionSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getIntrospectionSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetIntrospectionSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a Resolver object. *

* * @param getResolverRequest * @return Result of the GetResolver operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetResolver * @see AWS API * Documentation */ @Override public GetResolverResponse getResolver(GetResolverRequest getResolverRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetResolverResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResolverRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getResolverRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResolver"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetResolver").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(getResolverRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetResolverRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the current status of a schema creation operation. *

* * @param getSchemaCreationStatusRequest * @return Result of the GetSchemaCreationStatus operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetSchemaCreationStatus * @see AWS API Documentation */ @Override public GetSchemaCreationStatusResponse getSchemaCreationStatus(GetSchemaCreationStatusRequest getSchemaCreationStatusRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSchemaCreationStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSchemaCreationStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSchemaCreationStatusRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSchemaCreationStatus"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSchemaCreationStatus").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getSchemaCreationStatusRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetSchemaCreationStatusRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a SourceApiAssociation object. *

* * @param getSourceApiAssociationRequest * @return Result of the GetSourceApiAssociation operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetSourceApiAssociation * @see AWS API Documentation */ @Override public GetSourceApiAssociationResponse getSourceApiAssociation(GetSourceApiAssociationRequest getSourceApiAssociationRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSourceApiAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSourceApiAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSourceApiAssociationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSourceApiAssociation"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSourceApiAssociation").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getSourceApiAssociationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetSourceApiAssociationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a Type object. *

* * @param getTypeRequest * @return Result of the GetType operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.GetType * @see AWS API * Documentation */ @Override public GetTypeResponse getType(GetTypeRequest getTypeRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTypeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetType"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetType").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(getTypeRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetTypeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the API keys for a given API. *

* *

* API keys are deleted automatically 60 days after they expire. However, they may still be included in the response * until they have actually been deleted. You can safely call DeleteApiKey to manually delete a key * before it's automatically deleted. *

*
* * @param listApiKeysRequest * @return Result of the ListApiKeys operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListApiKeys * @see AWS API * Documentation */ @Override public ListApiKeysResponse listApiKeys(ListApiKeysRequest listApiKeysRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListApiKeysResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listApiKeysRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listApiKeysRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListApiKeys"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListApiKeys").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(listApiKeysRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListApiKeysRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the data sources for a given API. *

* * @param listDataSourcesRequest * @return Result of the ListDataSources operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListDataSources * @see AWS API * Documentation */ @Override public ListDataSourcesResponse listDataSources(ListDataSourcesRequest listDataSourcesRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDataSourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDataSourcesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDataSourcesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDataSources"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDataSources").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDataSourcesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDataSourcesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists multiple custom domain names. *

* * @param listDomainNamesRequest * @return Result of the ListDomainNames operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListDomainNames * @see AWS API * Documentation */ @Override public ListDomainNamesResponse listDomainNames(ListDomainNamesRequest listDomainNamesRequest) throws AccessDeniedException, BadRequestException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDomainNamesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDomainNamesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDomainNamesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDomainNames"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDomainNames").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDomainNamesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDomainNamesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List multiple functions. *

* * @param listFunctionsRequest * @return Result of the ListFunctions operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListFunctions * @see AWS API * Documentation */ @Override public ListFunctionsResponse listFunctions(ListFunctionsRequest listFunctionsRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListFunctionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listFunctionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listFunctionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFunctions"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListFunctions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listFunctionsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListFunctionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists your GraphQL APIs. *

* * @param listGraphqlApisRequest * @return Result of the ListGraphqlApis operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListGraphqlApis * @see AWS API * Documentation */ @Override public ListGraphqlApisResponse listGraphqlApis(ListGraphqlApisRequest listGraphqlApisRequest) throws BadRequestException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListGraphqlApisResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listGraphqlApisRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listGraphqlApisRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListGraphqlApis"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListGraphqlApis").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listGraphqlApisRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListGraphqlApisRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the resolvers for a given API and type. *

* * @param listResolversRequest * @return Result of the ListResolvers operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListResolvers * @see AWS API * Documentation */ @Override public ListResolversResponse listResolvers(ListResolversRequest listResolversRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListResolversResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listResolversRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listResolversRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResolvers"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListResolvers").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listResolversRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListResolversRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List the resolvers that are associated with a specific function. *

* * @param listResolversByFunctionRequest * @return Result of the ListResolversByFunction operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListResolversByFunction * @see AWS API Documentation */ @Override public ListResolversByFunctionResponse listResolversByFunction(ListResolversByFunctionRequest listResolversByFunctionRequest) throws BadRequestException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListResolversByFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listResolversByFunctionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listResolversByFunctionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResolversByFunction"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListResolversByFunction").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listResolversByFunctionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListResolversByFunctionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the SourceApiAssociationSummary data. *

* * @param listSourceApiAssociationsRequest * @return Result of the ListSourceApiAssociations operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListSourceApiAssociations * @see AWS API Documentation */ @Override public ListSourceApiAssociationsResponse listSourceApiAssociations( ListSourceApiAssociationsRequest listSourceApiAssociationsRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSourceApiAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSourceApiAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSourceApiAssociationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSourceApiAssociations"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSourceApiAssociations").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listSourceApiAssociationsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSourceApiAssociationsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists the tags for a resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListTagsForResource * @see AWS * API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws BadRequestException, NotFoundException, LimitExceededException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { 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, "AppSync"); 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())); } } /** *

* Lists the types for a given API. *

* * @param listTypesRequest * @return Result of the ListTypes operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListTypes * @see AWS API * Documentation */ @Override public ListTypesResponse listTypes(ListTypesRequest listTypesRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListTypesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTypesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTypesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTypes"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTypes").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(listTypesRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTypesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists Type objects by the source API association ID. *

* * @param listTypesByAssociationRequest * @return Result of the ListTypesByAssociation operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.ListTypesByAssociation * @see AWS API Documentation */ @Override public ListTypesByAssociationResponse listTypesByAssociation(ListTypesByAssociationRequest listTypesByAssociationRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTypesByAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTypesByAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTypesByAssociationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTypesByAssociation"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTypesByAssociation").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listTypesByAssociationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListTypesByAssociationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a list of environmental variables in an API by its ID value. *

*

* When creating an environmental variable, it must follow the constraints below: *

*
    *
  • *

    * Both JavaScript and VTL templates support environmental variables. *

    *
  • *
  • *

    * Environmental variables are not evaluated before function invocation. *

    *
  • *
  • *

    * Environmental variables only support string values. *

    *
  • *
  • *

    * Any defined value in an environmental variable is considered a string literal and not expanded. *

    *
  • *
  • *

    * Variable evaluations should ideally be performed in the function code. *

    *
  • *
*

* When creating an environmental variable key-value pair, it must follow the additional constraints below: *

*
    *
  • *

    * Keys must begin with a letter. *

    *
  • *
  • *

    * Keys must be at least two characters long. *

    *
  • *
  • *

    * Keys can only contain letters, numbers, and the underscore character (_). *

    *
  • *
  • *

    * Values can be up to 512 characters long. *

    *
  • *
  • *

    * You can configure up to 50 key-value pairs in a GraphQL API. *

    *
  • *
*

* You can create a list of environmental variables by adding it to the environmentVariables payload as * a list in the format {"key1":"value1","key2":"value2", …}. Note that each call of the * PutGraphqlApiEnvironmentVariables action will result in the overwriting of the existing * environmental variable list of that API. This means the existing environmental variables will be lost. To avoid * this, you must include all existing and new environmental variables in the list each time you call this action. *

* * @param putGraphqlApiEnvironmentVariablesRequest * @return Result of the PutGraphqlApiEnvironmentVariables operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.PutGraphqlApiEnvironmentVariables * @see AWS API Documentation */ @Override public PutGraphqlApiEnvironmentVariablesResponse putGraphqlApiEnvironmentVariables( PutGraphqlApiEnvironmentVariablesRequest putGraphqlApiEnvironmentVariablesRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutGraphqlApiEnvironmentVariablesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putGraphqlApiEnvironmentVariablesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putGraphqlApiEnvironmentVariablesRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutGraphqlApiEnvironmentVariables"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("PutGraphqlApiEnvironmentVariables").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putGraphqlApiEnvironmentVariablesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutGraphqlApiEnvironmentVariablesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a new introspection. Returns the introspectionId of the new introspection after its * creation. *

* * @param startDataSourceIntrospectionRequest * @return Result of the StartDataSourceIntrospection operation returned by the service. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.StartDataSourceIntrospection * @see AWS API Documentation */ @Override public StartDataSourceIntrospectionResponse startDataSourceIntrospection( StartDataSourceIntrospectionRequest startDataSourceIntrospectionRequest) throws NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartDataSourceIntrospectionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDataSourceIntrospectionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startDataSourceIntrospectionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDataSourceIntrospection"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("StartDataSourceIntrospection").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startDataSourceIntrospectionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartDataSourceIntrospectionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Adds a new schema to your GraphQL API. *

*

* This operation is asynchronous. Use to determine when it has completed. *

* * @param startSchemaCreationRequest * @return Result of the StartSchemaCreation operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.StartSchemaCreation * @see AWS * API Documentation */ @Override public StartSchemaCreationResponse startSchemaCreation(StartSchemaCreationRequest startSchemaCreationRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartSchemaCreationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startSchemaCreationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startSchemaCreationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartSchemaCreation"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartSchemaCreation").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startSchemaCreationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartSchemaCreationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Initiates a merge operation. Returns a status that shows the result of the merge operation. *

* * @param startSchemaMergeRequest * @return Result of the StartSchemaMerge operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.StartSchemaMerge * @see AWS API * Documentation */ @Override public StartSchemaMergeResponse startSchemaMerge(StartSchemaMergeRequest startSchemaMergeRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, ConcurrentModificationException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartSchemaMergeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startSchemaMergeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startSchemaMergeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartSchemaMerge"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartSchemaMerge").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startSchemaMergeRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartSchemaMergeRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Tags a resource with user-supplied tags. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.TagResource * @see AWS API * Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws BadRequestException, NotFoundException, LimitExceededException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { 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, "AppSync"); 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())); } } /** *

* Untags a resource. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UntagResource * @see AWS API * Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws BadRequestException, NotFoundException, LimitExceededException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { 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, "AppSync"); 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 cache for the GraphQL API. *

* * @param updateApiCacheRequest * Represents the input of a UpdateApiCache operation. * @return Result of the UpdateApiCache operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateApiCache * @see AWS API * Documentation */ @Override public UpdateApiCacheResponse updateApiCache(UpdateApiCacheRequest updateApiCacheRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateApiCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateApiCacheRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApiCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApiCache"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateApiCache").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateApiCacheRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateApiCacheRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates an API key. You can update the key as long as it's not deleted. *

* * @param updateApiKeyRequest * @return Result of the UpdateApiKey operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws LimitExceededException * The request exceeded a limit. Try your request again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws ApiKeyValidityOutOfBoundsException * The API key expiration must be set to a value between 1 and 365 days from creation (for * CreateApiKey) or from update (for UpdateApiKey). * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateApiKey * @see AWS API * Documentation */ @Override public UpdateApiKeyResponse updateApiKey(UpdateApiKeyRequest updateApiKeyRequest) throws BadRequestException, NotFoundException, UnauthorizedException, LimitExceededException, InternalFailureException, ApiKeyValidityOutOfBoundsException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateApiKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateApiKeyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApiKeyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApiKey"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateApiKey").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateApiKeyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateApiKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a DataSource object. *

* * @param updateDataSourceRequest * @return Result of the UpdateDataSource operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateDataSource * @see AWS API * Documentation */ @Override public UpdateDataSourceResponse updateDataSource(UpdateDataSourceRequest updateDataSourceRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateDataSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDataSourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDataSourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDataSource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateDataSource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateDataSourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateDataSourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a custom DomainName object. *

* * @param updateDomainNameRequest * @return Result of the UpdateDomainName operation returned by the service. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateDomainName * @see AWS API * Documentation */ @Override public UpdateDomainNameResponse updateDomainName(UpdateDomainNameRequest updateDomainNameRequest) throws AccessDeniedException, BadRequestException, ConcurrentModificationException, InternalFailureException, NotFoundException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateDomainNameResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDomainNameRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDomainNameRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDomainName"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateDomainName").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateDomainNameRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateDomainNameRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a Function object. *

* * @param updateFunctionRequest * @return Result of the UpdateFunction operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateFunction * @see AWS API * Documentation */ @Override public UpdateFunctionResponse updateFunction(UpdateFunctionRequest updateFunctionRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateFunctionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFunctionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFunctionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFunction"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateFunction").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateFunctionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateFunctionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a GraphqlApi object. *

* * @param updateGraphqlApiRequest * @return Result of the UpdateGraphqlApi operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws AccessDeniedException * You don't have access to perform this operation on this resource. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateGraphqlApi * @see AWS API * Documentation */ @Override public UpdateGraphqlApiResponse updateGraphqlApi(UpdateGraphqlApiRequest updateGraphqlApiRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AccessDeniedException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateGraphqlApiResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateGraphqlApiRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateGraphqlApiRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateGraphqlApi"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateGraphqlApi").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateGraphqlApiRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateGraphqlApiRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a Resolver object. *

* * @param updateResolverRequest * @return Result of the UpdateResolver operation returned by the service. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateResolver * @see AWS API * Documentation */ @Override public UpdateResolverResponse updateResolver(UpdateResolverRequest updateResolverRequest) throws ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, BadRequestException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateResolverResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateResolverRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateResolverRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateResolver"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateResolver").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateResolverRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateResolverRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates some of the configuration choices of a particular source API association. *

* * @param updateSourceApiAssociationRequest * @return Result of the UpdateSourceApiAssociation operation returned by the service. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateSourceApiAssociation * @see AWS API Documentation */ @Override public UpdateSourceApiAssociationResponse updateSourceApiAssociation( UpdateSourceApiAssociationRequest updateSourceApiAssociationRequest) throws UnauthorizedException, BadRequestException, InternalFailureException, NotFoundException, ConcurrentModificationException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSourceApiAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSourceApiAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSourceApiAssociationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSourceApiAssociation"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSourceApiAssociation").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateSourceApiAssociationRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateSourceApiAssociationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a Type object. *

* * @param updateTypeRequest * @return Result of the UpdateType operation returned by the service. * @throws BadRequestException * The request is not well formed. For example, a value is invalid or a required field is missing. Check the * field values, and then try again. * @throws ConcurrentModificationException * Another modification is in progress at this time and it must complete before you can make your change. * @throws NotFoundException * The resource specified in the request was not found. Check the resource, and then try again. * @throws UnauthorizedException * You aren't authorized to perform this operation. * @throws InternalFailureException * An internal AppSync error occurred. Try your request again. * @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 AppSyncException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample AppSyncClient.UpdateType * @see AWS API * Documentation */ @Override public UpdateTypeResponse updateType(UpdateTypeRequest updateTypeRequest) throws BadRequestException, ConcurrentModificationException, NotFoundException, UnauthorizedException, InternalFailureException, AwsServiceException, SdkClientException, AppSyncException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateTypeResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateTypeRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateTypeRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppSync"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateType"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateType").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(updateTypeRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateTypeRequestMarshaller(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(); } AppSyncServiceClientConfigurationBuilder serviceConfigBuilder = new AppSyncServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(AppSyncException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ConcurrentModificationException") .exceptionBuilderSupplier(ConcurrentModificationException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalFailureException") .exceptionBuilderSupplier(InternalFailureException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("GraphQLSchemaException") .exceptionBuilderSupplier(GraphQlSchemaException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ApiKeyLimitExceededException") .exceptionBuilderSupplier(ApiKeyLimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ApiLimitExceededException") .exceptionBuilderSupplier(ApiLimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotFoundException") .exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedException") .exceptionBuilderSupplier(UnauthorizedException::builder).httpStatusCode(401).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ApiKeyValidityOutOfBoundsException") .exceptionBuilderSupplier(ApiKeyValidityOutOfBoundsException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BadRequestException") .exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build()); } @Override public final AppSyncServiceClientConfiguration serviceClientConfiguration() { return new AppSyncServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy