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

software.amazon.awssdk.services.schemas.DefaultSchemasClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.schemas;

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.schemas.internal.SchemasServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.schemas.model.BadRequestException;
import software.amazon.awssdk.services.schemas.model.ConflictException;
import software.amazon.awssdk.services.schemas.model.CreateDiscovererRequest;
import software.amazon.awssdk.services.schemas.model.CreateDiscovererResponse;
import software.amazon.awssdk.services.schemas.model.CreateRegistryRequest;
import software.amazon.awssdk.services.schemas.model.CreateRegistryResponse;
import software.amazon.awssdk.services.schemas.model.CreateSchemaRequest;
import software.amazon.awssdk.services.schemas.model.CreateSchemaResponse;
import software.amazon.awssdk.services.schemas.model.DeleteDiscovererRequest;
import software.amazon.awssdk.services.schemas.model.DeleteDiscovererResponse;
import software.amazon.awssdk.services.schemas.model.DeleteRegistryRequest;
import software.amazon.awssdk.services.schemas.model.DeleteRegistryResponse;
import software.amazon.awssdk.services.schemas.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.schemas.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.schemas.model.DeleteSchemaRequest;
import software.amazon.awssdk.services.schemas.model.DeleteSchemaResponse;
import software.amazon.awssdk.services.schemas.model.DeleteSchemaVersionRequest;
import software.amazon.awssdk.services.schemas.model.DeleteSchemaVersionResponse;
import software.amazon.awssdk.services.schemas.model.DescribeCodeBindingRequest;
import software.amazon.awssdk.services.schemas.model.DescribeCodeBindingResponse;
import software.amazon.awssdk.services.schemas.model.DescribeDiscovererRequest;
import software.amazon.awssdk.services.schemas.model.DescribeDiscovererResponse;
import software.amazon.awssdk.services.schemas.model.DescribeRegistryRequest;
import software.amazon.awssdk.services.schemas.model.DescribeRegistryResponse;
import software.amazon.awssdk.services.schemas.model.DescribeSchemaRequest;
import software.amazon.awssdk.services.schemas.model.DescribeSchemaResponse;
import software.amazon.awssdk.services.schemas.model.ExportSchemaRequest;
import software.amazon.awssdk.services.schemas.model.ExportSchemaResponse;
import software.amazon.awssdk.services.schemas.model.ForbiddenException;
import software.amazon.awssdk.services.schemas.model.GetCodeBindingSourceRequest;
import software.amazon.awssdk.services.schemas.model.GetCodeBindingSourceResponse;
import software.amazon.awssdk.services.schemas.model.GetDiscoveredSchemaRequest;
import software.amazon.awssdk.services.schemas.model.GetDiscoveredSchemaResponse;
import software.amazon.awssdk.services.schemas.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.schemas.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.schemas.model.GoneException;
import software.amazon.awssdk.services.schemas.model.InternalServerErrorException;
import software.amazon.awssdk.services.schemas.model.ListDiscoverersRequest;
import software.amazon.awssdk.services.schemas.model.ListDiscoverersResponse;
import software.amazon.awssdk.services.schemas.model.ListRegistriesRequest;
import software.amazon.awssdk.services.schemas.model.ListRegistriesResponse;
import software.amazon.awssdk.services.schemas.model.ListSchemaVersionsRequest;
import software.amazon.awssdk.services.schemas.model.ListSchemaVersionsResponse;
import software.amazon.awssdk.services.schemas.model.ListSchemasRequest;
import software.amazon.awssdk.services.schemas.model.ListSchemasResponse;
import software.amazon.awssdk.services.schemas.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.schemas.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.schemas.model.NotFoundException;
import software.amazon.awssdk.services.schemas.model.PreconditionFailedException;
import software.amazon.awssdk.services.schemas.model.PutCodeBindingRequest;
import software.amazon.awssdk.services.schemas.model.PutCodeBindingResponse;
import software.amazon.awssdk.services.schemas.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.schemas.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.schemas.model.SchemasException;
import software.amazon.awssdk.services.schemas.model.SearchSchemasRequest;
import software.amazon.awssdk.services.schemas.model.SearchSchemasResponse;
import software.amazon.awssdk.services.schemas.model.ServiceUnavailableException;
import software.amazon.awssdk.services.schemas.model.StartDiscovererRequest;
import software.amazon.awssdk.services.schemas.model.StartDiscovererResponse;
import software.amazon.awssdk.services.schemas.model.StopDiscovererRequest;
import software.amazon.awssdk.services.schemas.model.StopDiscovererResponse;
import software.amazon.awssdk.services.schemas.model.TagResourceRequest;
import software.amazon.awssdk.services.schemas.model.TagResourceResponse;
import software.amazon.awssdk.services.schemas.model.TooManyRequestsException;
import software.amazon.awssdk.services.schemas.model.UnauthorizedException;
import software.amazon.awssdk.services.schemas.model.UntagResourceRequest;
import software.amazon.awssdk.services.schemas.model.UntagResourceResponse;
import software.amazon.awssdk.services.schemas.model.UpdateDiscovererRequest;
import software.amazon.awssdk.services.schemas.model.UpdateDiscovererResponse;
import software.amazon.awssdk.services.schemas.model.UpdateRegistryRequest;
import software.amazon.awssdk.services.schemas.model.UpdateRegistryResponse;
import software.amazon.awssdk.services.schemas.model.UpdateSchemaRequest;
import software.amazon.awssdk.services.schemas.model.UpdateSchemaResponse;
import software.amazon.awssdk.services.schemas.transform.CreateDiscovererRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.CreateRegistryRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.CreateSchemaRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DeleteDiscovererRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DeleteRegistryRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DeleteSchemaRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DeleteSchemaVersionRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DescribeCodeBindingRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DescribeDiscovererRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DescribeRegistryRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.DescribeSchemaRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.ExportSchemaRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.GetCodeBindingSourceRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.GetDiscoveredSchemaRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.GetResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.ListDiscoverersRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.ListRegistriesRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.ListSchemaVersionsRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.ListSchemasRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.PutCodeBindingRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.SearchSchemasRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.StartDiscovererRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.StopDiscovererRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.UpdateDiscovererRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.UpdateRegistryRequestMarshaller;
import software.amazon.awssdk.services.schemas.transform.UpdateSchemaRequestMarshaller;
import software.amazon.awssdk.services.schemas.waiters.SchemasWaiter;
import software.amazon.awssdk.utils.Logger;

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

    /**
     * 

* Creates a discoverer. *

* * @param createDiscovererRequest * @return Result of the CreateDiscoverer operation returned by the service. * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws UnauthorizedException * 401 response * @throws ForbiddenException * 403 response * @throws ServiceUnavailableException * 503 response * @throws ConflictException * 409 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.CreateDiscoverer * @see AWS API * Documentation */ @Override public CreateDiscovererResponse createDiscoverer(CreateDiscovererRequest createDiscovererRequest) throws BadRequestException, InternalServerErrorException, UnauthorizedException, ForbiddenException, ServiceUnavailableException, ConflictException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateDiscovererResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDiscovererRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDiscovererRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDiscoverer"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDiscoverer").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createDiscovererRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDiscovererRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a registry. *

* * @param createRegistryRequest * @return Result of the CreateRegistry operation returned by the service. * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws UnauthorizedException * 401 response * @throws ForbiddenException * 403 response * @throws ServiceUnavailableException * 503 response * @throws ConflictException * 409 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.CreateRegistry * @see AWS API * Documentation */ @Override public CreateRegistryResponse createRegistry(CreateRegistryRequest createRegistryRequest) throws BadRequestException, InternalServerErrorException, UnauthorizedException, ForbiddenException, ServiceUnavailableException, ConflictException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateRegistryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRegistryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createRegistryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRegistry"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateRegistry").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createRegistryRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateRegistryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a schema definition. *

* *

* Inactive schemas will be deleted after two years. *

*
* * @param createSchemaRequest * @return Result of the CreateSchema operation returned by the service. * @throws ServiceUnavailableException * 503 response * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.CreateSchema * @see AWS API * Documentation */ @Override public CreateSchemaResponse createSchema(CreateSchemaRequest createSchemaRequest) throws ServiceUnavailableException, BadRequestException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSchema"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a discoverer. *

* * @param deleteDiscovererRequest * @return Result of the DeleteDiscoverer operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DeleteDiscoverer * @see AWS API * Documentation */ @Override public DeleteDiscovererResponse deleteDiscoverer(DeleteDiscovererRequest deleteDiscovererRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteDiscovererResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDiscovererRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDiscovererRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDiscoverer"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteDiscoverer").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteDiscovererRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteDiscovererRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a Registry. *

* * @param deleteRegistryRequest * @return Result of the DeleteRegistry operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DeleteRegistry * @see AWS API * Documentation */ @Override public DeleteRegistryResponse deleteRegistry(DeleteRegistryRequest deleteRegistryRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteRegistryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRegistryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRegistryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRegistry"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteRegistry").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteRegistryRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteRegistryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete the resource-based policy attached to the specified registry. *

* * @param deleteResourcePolicyRequest * @return Result of the DeleteResourcePolicy operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DeleteResourcePolicy * @see AWS * API Documentation */ @Override public DeleteResourcePolicyResponse deleteResourcePolicy(DeleteResourcePolicyRequest deleteResourcePolicyRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteResourcePolicyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete a schema definition. *

* * @param deleteSchemaRequest * @return Result of the DeleteSchema operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DeleteSchema * @see AWS API * Documentation */ @Override public DeleteSchemaResponse deleteSchema(DeleteSchemaRequest deleteSchemaRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSchema"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Delete the schema version definition *

* * @param deleteSchemaVersionRequest * @return Result of the DeleteSchemaVersion operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DeleteSchemaVersion * @see AWS * API Documentation */ @Override public DeleteSchemaVersionResponse deleteSchemaVersion(DeleteSchemaVersionRequest deleteSchemaVersionRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSchemaVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSchemaVersionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSchemaVersionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSchemaVersion"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteSchemaVersion").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteSchemaVersionRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteSchemaVersionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Describe the code binding URI. *

* * @param describeCodeBindingRequest * @return Result of the DescribeCodeBinding operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws TooManyRequestsException * 429 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DescribeCodeBinding * @see AWS * API Documentation */ @Override public DescribeCodeBindingResponse describeCodeBinding(DescribeCodeBindingRequest describeCodeBindingRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, TooManyRequestsException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCodeBindingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCodeBindingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCodeBindingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCodeBinding"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeCodeBinding").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeCodeBindingRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeCodeBindingRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Describes the discoverer. *

* * @param describeDiscovererRequest * @return Result of the DescribeDiscoverer operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DescribeDiscoverer * @see AWS * API Documentation */ @Override public DescribeDiscovererResponse describeDiscoverer(DescribeDiscovererRequest describeDiscovererRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDiscovererResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDiscovererRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDiscovererRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDiscoverer"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeDiscoverer").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeDiscovererRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeDiscovererRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Describes the registry. *

* * @param describeRegistryRequest * @return Result of the DescribeRegistry operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DescribeRegistry * @see AWS API * Documentation */ @Override public DescribeRegistryResponse describeRegistry(DescribeRegistryRequest describeRegistryRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeRegistryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeRegistryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRegistryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRegistry"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeRegistry").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeRegistryRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeRegistryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieve the schema definition. *

* * @param describeSchemaRequest * @return Result of the DescribeSchema operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.DescribeSchema * @see AWS API * Documentation */ @Override public DescribeSchemaResponse describeSchema(DescribeSchemaRequest describeSchemaRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSchema"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** * Invokes the ExportSchema operation. * * @param exportSchemaRequest * @return Result of the ExportSchema operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @throws TooManyRequestsException * 429 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.ExportSchema * @see AWS API * Documentation */ @Override public ExportSchemaResponse exportSchema(ExportSchemaRequest exportSchemaRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ExportSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(exportSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, exportSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ExportSchema"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ExportSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(exportSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ExportSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get the code binding source URI. *

* * @param getCodeBindingSourceRequest * @return Result of the GetCodeBindingSource operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws TooManyRequestsException * 429 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.GetCodeBindingSource * @see AWS * API Documentation */ @Override public GetCodeBindingSourceResponse getCodeBindingSource(GetCodeBindingSourceRequest getCodeBindingSourceRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, TooManyRequestsException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCodeBindingSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCodeBindingSourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCodeBindingSourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCodeBindingSource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetCodeBindingSource").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getCodeBindingSourceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetCodeBindingSourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get the discovered schema that was generated based on sampled events. *

* * @param getDiscoveredSchemaRequest * @return Result of the GetDiscoveredSchema operation returned by the service. * @throws ServiceUnavailableException * 503 response * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.GetDiscoveredSchema * @see AWS * API Documentation */ @Override public GetDiscoveredSchemaResponse getDiscoveredSchema(GetDiscoveredSchemaRequest getDiscoveredSchemaRequest) throws ServiceUnavailableException, BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetDiscoveredSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDiscoveredSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDiscoveredSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDiscoveredSchema"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDiscoveredSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getDiscoveredSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDiscoveredSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the resource-based policy attached to a given registry. *

* * @param getResourcePolicyRequest * @return Result of the GetResourcePolicy operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.GetResourcePolicy * @see AWS API * Documentation */ @Override public GetResourcePolicyResponse getResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourcePolicy"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetResourcePolicy").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getResourcePolicyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetResourcePolicyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List the discoverers. *

* * @param listDiscoverersRequest * @return Result of the ListDiscoverers operation returned by the service. * @throws ServiceUnavailableException * 503 response * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.ListDiscoverers * @see AWS API * Documentation */ @Override public ListDiscoverersResponse listDiscoverers(ListDiscoverersRequest listDiscoverersRequest) throws ServiceUnavailableException, BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListDiscoverersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDiscoverersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDiscoverersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDiscoverers"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDiscoverers").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listDiscoverersRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDiscoverersRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List the registries. *

* * @param listRegistriesRequest * @return Result of the ListRegistries operation returned by the service. * @throws ServiceUnavailableException * 503 response * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.ListRegistries * @see AWS API * Documentation */ @Override public ListRegistriesResponse listRegistries(ListRegistriesRequest listRegistriesRequest) throws ServiceUnavailableException, BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListRegistriesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRegistriesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listRegistriesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRegistries"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListRegistries").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listRegistriesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListRegistriesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Provides a list of the schema versions and related information. *

* * @param listSchemaVersionsRequest * @return Result of the ListSchemaVersions operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.ListSchemaVersions * @see AWS * API Documentation */ @Override public ListSchemaVersionsResponse listSchemaVersions(ListSchemaVersionsRequest listSchemaVersionsRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSchemaVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSchemaVersionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSchemaVersionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSchemaVersions"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListSchemaVersions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listSchemaVersionsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSchemaVersionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* List the schemas. *

* * @param listSchemasRequest * @return Result of the ListSchemas operation returned by the service. * @throws ServiceUnavailableException * 503 response * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.ListSchemas * @see AWS API * Documentation */ @Override public ListSchemasResponse listSchemas(ListSchemasRequest listSchemasRequest) throws ServiceUnavailableException, BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListSchemasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSchemasRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSchemasRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSchemas"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListSchemas").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(listSchemasRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSchemasRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Get tags for resource. *

* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws NotFoundException * 404 response * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.ListTagsForResource * @see AWS * API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws NotFoundException, BadRequestException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { 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, "schemas"); 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())); } } /** *

* Put code binding URI *

* * @param putCodeBindingRequest * @return Result of the PutCodeBinding operation returned by the service. * @throws GoneException * 410 response * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws TooManyRequestsException * 429 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.PutCodeBinding * @see AWS API * Documentation */ @Override public PutCodeBindingResponse putCodeBinding(PutCodeBindingRequest putCodeBindingRequest) throws GoneException, BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, TooManyRequestsException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutCodeBindingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putCodeBindingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putCodeBindingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutCodeBinding"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("PutCodeBinding").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putCodeBindingRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutCodeBindingRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* The name of the policy. *

* * @param putResourcePolicyRequest * The name of the policy. * @return Result of the PutResourcePolicy operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws PreconditionFailedException * 412 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.PutResourcePolicy * @see AWS API * Documentation */ @Override public PutResourcePolicyResponse putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) throws BadRequestException, UnauthorizedException, PreconditionFailedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourcePolicy"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("PutResourcePolicy").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putResourcePolicyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutResourcePolicyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Search the schemas *

* * @param searchSchemasRequest * @return Result of the SearchSchemas operation returned by the service. * @throws ServiceUnavailableException * 503 response * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.SearchSchemas * @see AWS API * Documentation */ @Override public SearchSchemasResponse searchSchemas(SearchSchemasRequest searchSchemasRequest) throws ServiceUnavailableException, BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, SearchSchemasResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(searchSchemasRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, searchSchemasRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "SearchSchemas"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("SearchSchemas").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(searchSchemasRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new SearchSchemasRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts the discoverer *

* * @param startDiscovererRequest * @return Result of the StartDiscoverer operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.StartDiscoverer * @see AWS API * Documentation */ @Override public StartDiscovererResponse startDiscoverer(StartDiscovererRequest startDiscovererRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartDiscovererResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDiscovererRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startDiscovererRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDiscoverer"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartDiscoverer").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startDiscovererRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartDiscovererRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stops the discoverer *

* * @param stopDiscovererRequest * @return Result of the StopDiscoverer operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.StopDiscoverer * @see AWS API * Documentation */ @Override public StopDiscovererResponse stopDiscoverer(StopDiscovererRequest stopDiscovererRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopDiscovererResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopDiscovererRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopDiscovererRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopDiscoverer"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StopDiscoverer").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(stopDiscovererRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopDiscovererRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Add tags to a resource. *

* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws NotFoundException * 404 response * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.TagResource * @see AWS API * Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws NotFoundException, BadRequestException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { 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, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Removes tags from a resource. *

* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws NotFoundException * 404 response * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.UntagResource * @see AWS API * Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws NotFoundException, BadRequestException, InternalServerErrorException, ForbiddenException, AwsServiceException, SdkClientException, SchemasException { 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, "schemas"); 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 discoverer *

* * @param updateDiscovererRequest * @return Result of the UpdateDiscoverer operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.UpdateDiscoverer * @see AWS API * Documentation */ @Override public UpdateDiscovererResponse updateDiscoverer(UpdateDiscovererRequest updateDiscovererRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateDiscovererResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDiscovererRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDiscovererRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDiscoverer"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateDiscoverer").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateDiscovererRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateDiscovererRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a registry. *

* * @param updateRegistryRequest * Updates the registry. * @return Result of the UpdateRegistry operation returned by the service. * @throws BadRequestException * 400 response * @throws UnauthorizedException * 401 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.UpdateRegistry * @see AWS API * Documentation */ @Override public UpdateRegistryResponse updateRegistry(UpdateRegistryRequest updateRegistryRequest) throws BadRequestException, UnauthorizedException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateRegistryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateRegistryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRegistryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRegistry"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateRegistry").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateRegistryRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateRegistryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the schema definition *

* *

* Inactive schemas will be deleted after two years. *

*
* * @param updateSchemaRequest * @return Result of the UpdateSchema operation returned by the service. * @throws BadRequestException * 400 response * @throws InternalServerErrorException * 500 response * @throws ForbiddenException * 403 response * @throws NotFoundException * 404 response * @throws ServiceUnavailableException * 503 response * @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 SchemasException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample SchemasClient.UpdateSchema * @see AWS API * Documentation */ @Override public UpdateSchemaResponse updateSchema(UpdateSchemaRequest updateSchemaRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, SchemasException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateSchemaResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSchemaRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSchemaRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "schemas"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSchema"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateSchema").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateSchemaRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateSchemaRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** * Create an instance of {@link SchemasWaiter} using this client. *

* Waiters created via this method are managed by the SDK and resources will be released when the service client is * closed. * * @return an instance of {@link SchemasWaiter} */ @Override public SchemasWaiter waiter() { return SchemasWaiter.builder().client(this).build(); } @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(); } SchemasServiceClientConfigurationBuilder serviceConfigBuilder = new SchemasServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(SchemasException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("GoneException").exceptionBuilderSupplier(GoneException::builder) .httpStatusCode(410).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotFoundException") .exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedException") .exceptionBuilderSupplier(UnauthorizedException::builder).httpStatusCode(401).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("PreconditionFailedException") .exceptionBuilderSupplier(PreconditionFailedException::builder).httpStatusCode(412).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ForbiddenException") .exceptionBuilderSupplier(ForbiddenException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyRequestsException") .exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BadRequestException") .exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerErrorException") .exceptionBuilderSupplier(InternalServerErrorException::builder).httpStatusCode(500).build()); } @Override public final SchemasServiceClientConfiguration serviceClientConfiguration() { return new SchemasServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy