
com.amazonaws.services.appsync.AWSAppSyncClient Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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 com.amazonaws.services.appsync;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.services.appsync.AWSAppSyncClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.appsync.model.*;
import com.amazonaws.services.appsync.model.transform.*;
/**
* Client for accessing AWSAppSync. All service calls made using this client are blocking, and will not return until the
* service call completes.
*
*
* AWS AppSync provides API actions for creating and interacting with data sources using GraphQL from your application.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSAppSyncClient extends AmazonWebServiceClient implements AWSAppSync {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSAppSync.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "appsync";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.withContentTypeOverride("")
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ConcurrentModificationException").withModeledClass(
com.amazonaws.services.appsync.model.ConcurrentModificationException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalFailureException").withModeledClass(
com.amazonaws.services.appsync.model.InternalFailureException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ApiKeyValidityOutOfBoundsException").withModeledClass(
com.amazonaws.services.appsync.model.ApiKeyValidityOutOfBoundsException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("GraphQLSchemaException").withModeledClass(
com.amazonaws.services.appsync.model.GraphQLSchemaException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ApiLimitExceededException").withModeledClass(
com.amazonaws.services.appsync.model.ApiLimitExceededException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("NotFoundException").withModeledClass(
com.amazonaws.services.appsync.model.NotFoundException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("UnauthorizedException").withModeledClass(
com.amazonaws.services.appsync.model.UnauthorizedException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ApiKeyLimitExceededException").withModeledClass(
com.amazonaws.services.appsync.model.ApiKeyLimitExceededException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("BadRequestException").withModeledClass(
com.amazonaws.services.appsync.model.BadRequestException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withModeledClass(
com.amazonaws.services.appsync.model.LimitExceededException.class))
.withBaseServiceExceptionClass(com.amazonaws.services.appsync.model.AWSAppSyncException.class));
public static AWSAppSyncClientBuilder builder() {
return AWSAppSyncClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on AWSAppSync using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSAppSyncClient(AwsSyncClientParams clientParams) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("appsync.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/appsync/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/appsync/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Creates a unique key that you can distribute to clients who are executing 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws LimitExceededException
* The request exceeded a limit. Try your request again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws LimitExceededException
* The request exceeded a limit. Try your request again.
* @throws InternalFailureException
* An internal AWS 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
).
* @sample AWSAppSync.CreateApiKey
* @see AWS API
* Documentation
*/
@Override
public CreateApiKeyResult createApiKey(CreateApiKeyRequest request) {
request = beforeClientExecution(request);
return executeCreateApiKey(request);
}
@SdkInternalApi
final CreateApiKeyResult executeCreateApiKey(CreateApiKeyRequest createApiKeyRequest) {
ExecutionContext executionContext = createExecutionContext(createApiKeyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateApiKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createApiKeyRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateApiKeyResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.CreateDataSource
* @see AWS API
* Documentation
*/
@Override
public CreateDataSourceResult createDataSource(CreateDataSourceRequest request) {
request = beforeClientExecution(request);
return executeCreateDataSource(request);
}
@SdkInternalApi
final CreateDataSourceResult executeCreateDataSource(CreateDataSourceRequest createDataSourceRequest) {
ExecutionContext executionContext = createExecutionContext(createDataSourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDataSourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDataSourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDataSourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws LimitExceededException
* The request exceeded a limit. Try your request again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @throws ApiLimitExceededException
* The GraphQL API exceeded a limit. Try your request again.
* @sample AWSAppSync.CreateGraphqlApi
* @see AWS API
* Documentation
*/
@Override
public CreateGraphqlApiResult createGraphqlApi(CreateGraphqlApiRequest request) {
request = beforeClientExecution(request);
return executeCreateGraphqlApi(request);
}
@SdkInternalApi
final CreateGraphqlApiResult executeCreateGraphqlApi(CreateGraphqlApiRequest createGraphqlApiRequest) {
ExecutionContext executionContext = createExecutionContext(createGraphqlApiRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateGraphqlApiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createGraphqlApiRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateGraphqlApiResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.CreateResolver
* @see AWS API
* Documentation
*/
@Override
public CreateResolverResult createResolver(CreateResolverRequest request) {
request = beforeClientExecution(request);
return executeCreateResolver(request);
}
@SdkInternalApi
final CreateResolverResult executeCreateResolver(CreateResolverRequest createResolverRequest) {
ExecutionContext executionContext = createExecutionContext(createResolverRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateResolverRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createResolverRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateResolverResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.CreateType
* @see AWS API
* Documentation
*/
@Override
public CreateTypeResult createType(CreateTypeRequest request) {
request = beforeClientExecution(request);
return executeCreateType(request);
}
@SdkInternalApi
final CreateTypeResult executeCreateType(CreateTypeRequest createTypeRequest) {
ExecutionContext executionContext = createExecutionContext(createTypeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTypeRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTypeResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.DeleteApiKey
* @see AWS API
* Documentation
*/
@Override
public DeleteApiKeyResult deleteApiKey(DeleteApiKeyRequest request) {
request = beforeClientExecution(request);
return executeDeleteApiKey(request);
}
@SdkInternalApi
final DeleteApiKeyResult executeDeleteApiKey(DeleteApiKeyRequest deleteApiKeyRequest) {
ExecutionContext executionContext = createExecutionContext(deleteApiKeyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteApiKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApiKeyRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApiKeyResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.DeleteDataSource
* @see AWS API
* Documentation
*/
@Override
public DeleteDataSourceResult deleteDataSource(DeleteDataSourceRequest request) {
request = beforeClientExecution(request);
return executeDeleteDataSource(request);
}
@SdkInternalApi
final DeleteDataSourceResult executeDeleteDataSource(DeleteDataSourceRequest deleteDataSourceRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDataSourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDataSourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDataSourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDataSourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.DeleteGraphqlApi
* @see AWS API
* Documentation
*/
@Override
public DeleteGraphqlApiResult deleteGraphqlApi(DeleteGraphqlApiRequest request) {
request = beforeClientExecution(request);
return executeDeleteGraphqlApi(request);
}
@SdkInternalApi
final DeleteGraphqlApiResult executeDeleteGraphqlApi(DeleteGraphqlApiRequest deleteGraphqlApiRequest) {
ExecutionContext executionContext = createExecutionContext(deleteGraphqlApiRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteGraphqlApiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteGraphqlApiRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteGraphqlApiResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a Resolver
object.
*
*
* @param deleteResolverRequest
* @return Result of the DeleteResolver operation returned by the service.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.DeleteResolver
* @see AWS API
* Documentation
*/
@Override
public DeleteResolverResult deleteResolver(DeleteResolverRequest request) {
request = beforeClientExecution(request);
return executeDeleteResolver(request);
}
@SdkInternalApi
final DeleteResolverResult executeDeleteResolver(DeleteResolverRequest deleteResolverRequest) {
ExecutionContext executionContext = createExecutionContext(deleteResolverRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteResolverRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteResolverRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteResolverResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.DeleteType
* @see AWS API
* Documentation
*/
@Override
public DeleteTypeResult deleteType(DeleteTypeRequest request) {
request = beforeClientExecution(request);
return executeDeleteType(request);
}
@SdkInternalApi
final DeleteTypeResult executeDeleteType(DeleteTypeRequest deleteTypeRequest) {
ExecutionContext executionContext = createExecutionContext(deleteTypeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTypeRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTypeResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.GetDataSource
* @see AWS API
* Documentation
*/
@Override
public GetDataSourceResult getDataSource(GetDataSourceRequest request) {
request = beforeClientExecution(request);
return executeGetDataSource(request);
}
@SdkInternalApi
final GetDataSourceResult executeGetDataSource(GetDataSourceRequest getDataSourceRequest) {
ExecutionContext executionContext = createExecutionContext(getDataSourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDataSourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDataSourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDataSourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.GetGraphqlApi
* @see AWS API
* Documentation
*/
@Override
public GetGraphqlApiResult getGraphqlApi(GetGraphqlApiRequest request) {
request = beforeClientExecution(request);
return executeGetGraphqlApi(request);
}
@SdkInternalApi
final GetGraphqlApiResult executeGetGraphqlApi(GetGraphqlApiRequest getGraphqlApiRequest) {
ExecutionContext executionContext = createExecutionContext(getGraphqlApiRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetGraphqlApiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getGraphqlApiRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetGraphqlApiResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.GetIntrospectionSchema
* @see AWS
* API Documentation
*/
@Override
public GetIntrospectionSchemaResult getIntrospectionSchema(GetIntrospectionSchemaRequest request) {
request = beforeClientExecution(request);
return executeGetIntrospectionSchema(request);
}
@SdkInternalApi
final GetIntrospectionSchemaResult executeGetIntrospectionSchema(GetIntrospectionSchemaRequest getIntrospectionSchemaRequest) {
ExecutionContext executionContext = createExecutionContext(getIntrospectionSchemaRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetIntrospectionSchemaRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIntrospectionSchemaRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(false),
new GetIntrospectionSchemaResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves a Resolver
object.
*
*
* @param getResolverRequest
* @return Result of the GetResolver operation returned by the service.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @sample AWSAppSync.GetResolver
* @see AWS API
* Documentation
*/
@Override
public GetResolverResult getResolver(GetResolverRequest request) {
request = beforeClientExecution(request);
return executeGetResolver(request);
}
@SdkInternalApi
final GetResolverResult executeGetResolver(GetResolverRequest getResolverRequest) {
ExecutionContext executionContext = createExecutionContext(getResolverRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetResolverRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getResolverRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetResolverResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.GetSchemaCreationStatus
* @see AWS API Documentation
*/
@Override
public GetSchemaCreationStatusResult getSchemaCreationStatus(GetSchemaCreationStatusRequest request) {
request = beforeClientExecution(request);
return executeGetSchemaCreationStatus(request);
}
@SdkInternalApi
final GetSchemaCreationStatusResult executeGetSchemaCreationStatus(GetSchemaCreationStatusRequest getSchemaCreationStatusRequest) {
ExecutionContext executionContext = createExecutionContext(getSchemaCreationStatusRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetSchemaCreationStatusRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(getSchemaCreationStatusRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetSchemaCreationStatusResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.GetType
* @see AWS API
* Documentation
*/
@Override
public GetTypeResult getType(GetTypeRequest request) {
request = beforeClientExecution(request);
return executeGetType(request);
}
@SdkInternalApi
final GetTypeResult executeGetType(GetTypeRequest getTypeRequest) {
ExecutionContext executionContext = createExecutionContext(getTypeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTypeRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTypeResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the API keys for a given API.
*
*
*
* API keys are deleted automatically sometime 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.ListApiKeys
* @see AWS API
* Documentation
*/
@Override
public ListApiKeysResult listApiKeys(ListApiKeysRequest request) {
request = beforeClientExecution(request);
return executeListApiKeys(request);
}
@SdkInternalApi
final ListApiKeysResult executeListApiKeys(ListApiKeysRequest listApiKeysRequest) {
ExecutionContext executionContext = createExecutionContext(listApiKeysRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListApiKeysRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listApiKeysRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListApiKeysResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.ListDataSources
* @see AWS API
* Documentation
*/
@Override
public ListDataSourcesResult listDataSources(ListDataSourcesRequest request) {
request = beforeClientExecution(request);
return executeListDataSources(request);
}
@SdkInternalApi
final ListDataSourcesResult executeListDataSources(ListDataSourcesRequest listDataSourcesRequest) {
ExecutionContext executionContext = createExecutionContext(listDataSourcesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDataSourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDataSourcesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDataSourcesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.ListGraphqlApis
* @see AWS API
* Documentation
*/
@Override
public ListGraphqlApisResult listGraphqlApis(ListGraphqlApisRequest request) {
request = beforeClientExecution(request);
return executeListGraphqlApis(request);
}
@SdkInternalApi
final ListGraphqlApisResult executeListGraphqlApis(ListGraphqlApisRequest listGraphqlApisRequest) {
ExecutionContext executionContext = createExecutionContext(listGraphqlApisRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListGraphqlApisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listGraphqlApisRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListGraphqlApisResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.ListResolvers
* @see AWS API
* Documentation
*/
@Override
public ListResolversResult listResolvers(ListResolversRequest request) {
request = beforeClientExecution(request);
return executeListResolvers(request);
}
@SdkInternalApi
final ListResolversResult executeListResolvers(ListResolversRequest listResolversRequest) {
ExecutionContext executionContext = createExecutionContext(listResolversRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListResolversRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listResolversRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListResolversResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.ListTypes
* @see AWS API
* Documentation
*/
@Override
public ListTypesResult listTypes(ListTypesRequest request) {
request = beforeClientExecution(request);
return executeListTypes(request);
}
@SdkInternalApi
final ListTypesResult executeListTypes(ListTypesRequest listTypesRequest) {
ExecutionContext executionContext = createExecutionContext(listTypesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTypesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTypesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTypesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.StartSchemaCreation
* @see AWS
* API Documentation
*/
@Override
public StartSchemaCreationResult startSchemaCreation(StartSchemaCreationRequest request) {
request = beforeClientExecution(request);
return executeStartSchemaCreation(request);
}
@SdkInternalApi
final StartSchemaCreationResult executeStartSchemaCreation(StartSchemaCreationRequest startSchemaCreationRequest) {
ExecutionContext executionContext = createExecutionContext(startSchemaCreationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartSchemaCreationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startSchemaCreationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartSchemaCreationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates an API key.
*
*
* @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 try again.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws LimitExceededException
* The request exceeded a limit. Try your request again.
* @throws InternalFailureException
* An internal AWS 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
).
* @sample AWSAppSync.UpdateApiKey
* @see AWS API
* Documentation
*/
@Override
public UpdateApiKeyResult updateApiKey(UpdateApiKeyRequest request) {
request = beforeClientExecution(request);
return executeUpdateApiKey(request);
}
@SdkInternalApi
final UpdateApiKeyResult executeUpdateApiKey(UpdateApiKeyRequest updateApiKeyRequest) {
ExecutionContext executionContext = createExecutionContext(updateApiKeyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateApiKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateApiKeyRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateApiKeyResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.UpdateDataSource
* @see AWS API
* Documentation
*/
@Override
public UpdateDataSourceResult updateDataSource(UpdateDataSourceRequest request) {
request = beforeClientExecution(request);
return executeUpdateDataSource(request);
}
@SdkInternalApi
final UpdateDataSourceResult executeUpdateDataSource(UpdateDataSourceRequest updateDataSourceRequest) {
ExecutionContext executionContext = createExecutionContext(updateDataSourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateDataSourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDataSourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDataSourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.UpdateGraphqlApi
* @see AWS API
* Documentation
*/
@Override
public UpdateGraphqlApiResult updateGraphqlApi(UpdateGraphqlApiRequest request) {
request = beforeClientExecution(request);
return executeUpdateGraphqlApi(request);
}
@SdkInternalApi
final UpdateGraphqlApiResult executeUpdateGraphqlApi(UpdateGraphqlApiRequest updateGraphqlApiRequest) {
ExecutionContext executionContext = createExecutionContext(updateGraphqlApiRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateGraphqlApiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGraphqlApiRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateGraphqlApiResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates a Resolver
object.
*
*
* @param updateResolverRequest
* @return Result of the UpdateResolver operation returned by the service.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.UpdateResolver
* @see AWS API
* Documentation
*/
@Override
public UpdateResolverResult updateResolver(UpdateResolverRequest request) {
request = beforeClientExecution(request);
return executeUpdateResolver(request);
}
@SdkInternalApi
final UpdateResolverResult executeUpdateResolver(UpdateResolverRequest updateResolverRequest) {
ExecutionContext executionContext = createExecutionContext(updateResolverRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateResolverRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateResolverRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateResolverResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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 try again.
* @throws ConcurrentModificationException
* Another modification is being made. That modification must complete before you can make your change.
* @throws NotFoundException
* The resource specified in the request was not found. Check the resource and try again.
* @throws UnauthorizedException
* You are not authorized to perform this operation.
* @throws InternalFailureException
* An internal AWS AppSync error occurred. Try your request again.
* @sample AWSAppSync.UpdateType
* @see AWS API
* Documentation
*/
@Override
public UpdateTypeResult updateType(UpdateTypeRequest request) {
request = beforeClientExecution(request);
return executeUpdateType(request);
}
@SdkInternalApi
final UpdateTypeResult executeUpdateType(UpdateTypeRequest updateTypeRequest) {
ExecutionContext executionContext = createExecutionContext(updateTypeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateTypeRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateTypeResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private Response anonymousInvoke(Request request,
HttpResponseHandler> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private Response doInvoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
request.setEndpoint(endpoint);
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
}