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

software.amazon.awssdk.services.codecatalyst.DefaultCodeCatalystClient Maven / Gradle / Ivy

Go to download

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

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

package software.amazon.awssdk.services.codecatalyst;

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.CredentialType;
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.codecatalyst.internal.CodeCatalystServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.codecatalyst.model.AccessDeniedException;
import software.amazon.awssdk.services.codecatalyst.model.CodeCatalystException;
import software.amazon.awssdk.services.codecatalyst.model.ConflictException;
import software.amazon.awssdk.services.codecatalyst.model.CreateAccessTokenRequest;
import software.amazon.awssdk.services.codecatalyst.model.CreateAccessTokenResponse;
import software.amazon.awssdk.services.codecatalyst.model.CreateDevEnvironmentRequest;
import software.amazon.awssdk.services.codecatalyst.model.CreateDevEnvironmentResponse;
import software.amazon.awssdk.services.codecatalyst.model.CreateProjectRequest;
import software.amazon.awssdk.services.codecatalyst.model.CreateProjectResponse;
import software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryBranchRequest;
import software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryBranchResponse;
import software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryRequest;
import software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryResponse;
import software.amazon.awssdk.services.codecatalyst.model.DeleteAccessTokenRequest;
import software.amazon.awssdk.services.codecatalyst.model.DeleteAccessTokenResponse;
import software.amazon.awssdk.services.codecatalyst.model.DeleteDevEnvironmentRequest;
import software.amazon.awssdk.services.codecatalyst.model.DeleteDevEnvironmentResponse;
import software.amazon.awssdk.services.codecatalyst.model.DeleteProjectRequest;
import software.amazon.awssdk.services.codecatalyst.model.DeleteProjectResponse;
import software.amazon.awssdk.services.codecatalyst.model.DeleteSourceRepositoryRequest;
import software.amazon.awssdk.services.codecatalyst.model.DeleteSourceRepositoryResponse;
import software.amazon.awssdk.services.codecatalyst.model.DeleteSpaceRequest;
import software.amazon.awssdk.services.codecatalyst.model.DeleteSpaceResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetDevEnvironmentRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetDevEnvironmentResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetProjectRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetProjectResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetSourceRepositoryCloneUrlsRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetSourceRepositoryCloneUrlsResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetSourceRepositoryRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetSourceRepositoryResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetSpaceRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetSpaceResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetUserDetailsRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetUserDetailsResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetWorkflowRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetWorkflowResponse;
import software.amazon.awssdk.services.codecatalyst.model.GetWorkflowRunRequest;
import software.amazon.awssdk.services.codecatalyst.model.GetWorkflowRunResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListAccessTokensRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListAccessTokensResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListDevEnvironmentSessionsRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListDevEnvironmentSessionsResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListDevEnvironmentsRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListDevEnvironmentsResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListEventLogsRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListEventLogsResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListProjectsRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListProjectsResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListSourceRepositoriesRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListSourceRepositoriesResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListSourceRepositoryBranchesRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListSourceRepositoryBranchesResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListSpacesRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListSpacesResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsResponse;
import software.amazon.awssdk.services.codecatalyst.model.ListWorkflowsRequest;
import software.amazon.awssdk.services.codecatalyst.model.ListWorkflowsResponse;
import software.amazon.awssdk.services.codecatalyst.model.ResourceNotFoundException;
import software.amazon.awssdk.services.codecatalyst.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.codecatalyst.model.StartDevEnvironmentRequest;
import software.amazon.awssdk.services.codecatalyst.model.StartDevEnvironmentResponse;
import software.amazon.awssdk.services.codecatalyst.model.StartDevEnvironmentSessionRequest;
import software.amazon.awssdk.services.codecatalyst.model.StartDevEnvironmentSessionResponse;
import software.amazon.awssdk.services.codecatalyst.model.StartWorkflowRunRequest;
import software.amazon.awssdk.services.codecatalyst.model.StartWorkflowRunResponse;
import software.amazon.awssdk.services.codecatalyst.model.StopDevEnvironmentRequest;
import software.amazon.awssdk.services.codecatalyst.model.StopDevEnvironmentResponse;
import software.amazon.awssdk.services.codecatalyst.model.StopDevEnvironmentSessionRequest;
import software.amazon.awssdk.services.codecatalyst.model.StopDevEnvironmentSessionResponse;
import software.amazon.awssdk.services.codecatalyst.model.ThrottlingException;
import software.amazon.awssdk.services.codecatalyst.model.UpdateDevEnvironmentRequest;
import software.amazon.awssdk.services.codecatalyst.model.UpdateDevEnvironmentResponse;
import software.amazon.awssdk.services.codecatalyst.model.UpdateProjectRequest;
import software.amazon.awssdk.services.codecatalyst.model.UpdateProjectResponse;
import software.amazon.awssdk.services.codecatalyst.model.UpdateSpaceRequest;
import software.amazon.awssdk.services.codecatalyst.model.UpdateSpaceResponse;
import software.amazon.awssdk.services.codecatalyst.model.ValidationException;
import software.amazon.awssdk.services.codecatalyst.model.VerifySessionRequest;
import software.amazon.awssdk.services.codecatalyst.model.VerifySessionResponse;
import software.amazon.awssdk.services.codecatalyst.transform.CreateAccessTokenRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.CreateDevEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.CreateProjectRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.CreateSourceRepositoryBranchRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.CreateSourceRepositoryRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.DeleteAccessTokenRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.DeleteDevEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.DeleteProjectRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.DeleteSourceRepositoryRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.DeleteSpaceRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetDevEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetProjectRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetSourceRepositoryCloneUrlsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetSourceRepositoryRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetSpaceRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetUserDetailsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetWorkflowRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.GetWorkflowRunRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListAccessTokensRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListDevEnvironmentSessionsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListDevEnvironmentsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListEventLogsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListProjectsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListSourceRepositoriesRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListSourceRepositoryBranchesRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListSpacesRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListWorkflowRunsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.ListWorkflowsRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.StartDevEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.StartDevEnvironmentSessionRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.StartWorkflowRunRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.StopDevEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.StopDevEnvironmentSessionRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.UpdateDevEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.UpdateProjectRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.UpdateSpaceRequestMarshaller;
import software.amazon.awssdk.services.codecatalyst.transform.VerifySessionRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

/**
 * Internal implementation of {@link CodeCatalystClient}.
 *
 * @see CodeCatalystClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultCodeCatalystClient implements CodeCatalystClient {
    private static final Logger log = Logger.loggerFor(DefaultCodeCatalystClient.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 DefaultCodeCatalystClient(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 personal access token (PAT) for the current user. A personal access token (PAT) is similar to a * password. It is associated with your user identity for use across all spaces and projects in Amazon CodeCatalyst. * You use PATs to access CodeCatalyst from resources that include integrated development environments (IDEs) and * Git-based source repositories. PATs represent you in Amazon CodeCatalyst and you can manage them in your user * settings.For more information, see Managing personal access * tokens in Amazon CodeCatalyst. *

* * @param createAccessTokenRequest * @return Result of the CreateAccessToken operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.CreateAccessToken * @see AWS API Documentation */ @Override public CreateAccessTokenResponse createAccessToken(CreateAccessTokenRequest createAccessTokenRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateAccessTokenResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAccessTokenRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAccessTokenRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAccessToken"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateAccessToken").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(createAccessTokenRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateAccessTokenRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a Dev Environment in Amazon CodeCatalyst, a cloud-based development environment that you can use to * quickly work on the code stored in the source repositories of your project. *

* *

* When created in the Amazon CodeCatalyst console, by default a Dev Environment is configured to have a 2 core * processor, 4GB of RAM, and 16GB of persistent storage. None of these defaults apply to a Dev Environment created * programmatically. *

*
* * @param createDevEnvironmentRequest * @return Result of the CreateDevEnvironment operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.CreateDevEnvironment * @see AWS API Documentation */ @Override public CreateDevEnvironmentResponse createDevEnvironment(CreateDevEnvironmentRequest createDevEnvironmentRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDevEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDevEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDevEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDevEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateDevEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(createDevEnvironmentRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateDevEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a project in a specified space. *

* * @param createProjectRequest * @return Result of the CreateProject operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.CreateProject * @see AWS * API Documentation */ @Override public CreateProjectResponse createProject(CreateProjectRequest createProjectRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateProjectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createProjectRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createProjectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(createProjectRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates an empty Git-based source repository in a specified project. The repository is created with an initial * empty commit with a default branch named main. *

* * @param createSourceRepositoryRequest * @return Result of the CreateSourceRepository operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.CreateSourceRepository * @see AWS API Documentation */ @Override public CreateSourceRepositoryResponse createSourceRepository(CreateSourceRepositoryRequest createSourceRepositoryRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSourceRepositoryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSourceRepositoryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSourceRepositoryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSourceRepository"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSourceRepository").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(createSourceRepositoryRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateSourceRepositoryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a branch in a specified source repository in Amazon CodeCatalyst. *

* *

* This API only creates a branch in a source repository hosted in Amazon CodeCatalyst. You cannot use this API to * create a branch in a linked repository. *

*
* * @param createSourceRepositoryBranchRequest * @return Result of the CreateSourceRepositoryBranch operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.CreateSourceRepositoryBranch * @see AWS API Documentation */ @Override public CreateSourceRepositoryBranchResponse createSourceRepositoryBranch( CreateSourceRepositoryBranchRequest createSourceRepositoryBranchRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSourceRepositoryBranchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSourceRepositoryBranchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSourceRepositoryBranchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSourceRepositoryBranch"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSourceRepositoryBranch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(createSourceRepositoryBranchRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateSourceRepositoryBranchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a specified personal access token (PAT). A personal access token can only be deleted by the user who * created it. *

* * @param deleteAccessTokenRequest * @return Result of the DeleteAccessToken operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.DeleteAccessToken * @see AWS API Documentation */ @Override public DeleteAccessTokenResponse deleteAccessToken(DeleteAccessTokenRequest deleteAccessTokenRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteAccessTokenResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAccessTokenRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAccessTokenRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAccessToken"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteAccessToken").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(deleteAccessTokenRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteAccessTokenRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a Dev Environment. *

* * @param deleteDevEnvironmentRequest * @return Result of the DeleteDevEnvironment operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.DeleteDevEnvironment * @see AWS API Documentation */ @Override public DeleteDevEnvironmentResponse deleteDevEnvironment(DeleteDevEnvironmentRequest deleteDevEnvironmentRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDevEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDevEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDevEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDevEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteDevEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(deleteDevEnvironmentRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteDevEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a project in a space. *

* * @param deleteProjectRequest * @return Result of the DeleteProject operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.DeleteProject * @see AWS * API Documentation */ @Override public DeleteProjectResponse deleteProject(DeleteProjectRequest deleteProjectRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteProjectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteProjectRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteProjectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(deleteProjectRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a source repository in Amazon CodeCatalyst. You cannot use this API to delete a linked repository. It can * only be used to delete a Amazon CodeCatalyst source repository. *

* * @param deleteSourceRepositoryRequest * @return Result of the DeleteSourceRepository operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.DeleteSourceRepository * @see AWS API Documentation */ @Override public DeleteSourceRepositoryResponse deleteSourceRepository(DeleteSourceRepositoryRequest deleteSourceRepositoryRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSourceRepositoryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSourceRepositoryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSourceRepositoryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSourceRepository"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSourceRepository").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(deleteSourceRepositoryRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteSourceRepositoryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a space. *

* *

* Deleting a space cannot be undone. Additionally, since space names must be unique across Amazon CodeCatalyst, you * cannot reuse names of deleted spaces. *

*
* * @param deleteSpaceRequest * @return Result of the DeleteSpace operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.DeleteSpace * @see AWS API * Documentation */ @Override public DeleteSpaceResponse deleteSpace(DeleteSpaceRequest deleteSpaceRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteSpaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSpaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSpaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSpace"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteSpace").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).credentialType(CredentialType.TOKEN) .withRequestConfiguration(clientConfiguration).withInput(deleteSpaceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteSpaceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about a Dev Environment for a source repository in a project. Dev Environments are specific * to the user who creates them. *

* * @param getDevEnvironmentRequest * @return Result of the GetDevEnvironment operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetDevEnvironment * @see AWS API Documentation */ @Override public GetDevEnvironmentResponse getDevEnvironment(GetDevEnvironmentRequest getDevEnvironmentRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDevEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDevEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getDevEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDevEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetDevEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(getDevEnvironmentRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetDevEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about a project. *

* * @param getProjectRequest * @return Result of the GetProject operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetProject * @see AWS API * Documentation */ @Override public GetProjectResponse getProject(GetProjectRequest getProjectRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetProjectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getProjectRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getProjectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetProject"); return clientHandler .execute(new ClientExecutionParams().withOperationName("GetProject") .withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).credentialType(CredentialType.TOKEN) .withRequestConfiguration(clientConfiguration).withInput(getProjectRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about a source repository. *

* * @param getSourceRepositoryRequest * @return Result of the GetSourceRepository operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetSourceRepository * @see AWS API Documentation */ @Override public GetSourceRepositoryResponse getSourceRepository(GetSourceRepositoryRequest getSourceRepositoryRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSourceRepositoryResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSourceRepositoryRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSourceRepositoryRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSourceRepository"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetSourceRepository").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(getSourceRepositoryRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetSourceRepositoryRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about the URLs that can be used with a Git client to clone a source repository. *

* * @param getSourceRepositoryCloneUrlsRequest * @return Result of the GetSourceRepositoryCloneUrls operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetSourceRepositoryCloneUrls * @see AWS API Documentation */ @Override public GetSourceRepositoryCloneUrlsResponse getSourceRepositoryCloneUrls( GetSourceRepositoryCloneUrlsRequest getSourceRepositoryCloneUrlsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSourceRepositoryCloneUrlsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSourceRepositoryCloneUrlsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSourceRepositoryCloneUrlsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSourceRepositoryCloneUrls"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSourceRepositoryCloneUrls").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(getSourceRepositoryCloneUrlsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetSourceRepositoryCloneUrlsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about an space. *

* * @param getSpaceRequest * @return Result of the GetSpace operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetSpace * @see AWS API * Documentation */ @Override public GetSpaceResponse getSpace(GetSpaceRequest getSpaceRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSpaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSpaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSpaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSpace"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetSpace").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).credentialType(CredentialType.TOKEN) .withRequestConfiguration(clientConfiguration).withInput(getSpaceRequest) .withMetricCollector(apiCallMetricCollector).withMarshaller(new GetSpaceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about the Amazon Web Services account used for billing purposes and the billing plan for the * space. *

* * @param getSubscriptionRequest * @return Result of the GetSubscription operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetSubscription * @see AWS * API Documentation */ @Override public GetSubscriptionResponse getSubscription(GetSubscriptionRequest getSubscriptionRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSubscriptionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSubscriptionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSubscriptionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSubscription"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetSubscription").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(getSubscriptionRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetSubscriptionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about a user. *

* * @param getUserDetailsRequest * @return Result of the GetUserDetails operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetUserDetails * @see AWS * API Documentation */ @Override public GetUserDetailsResponse getUserDetails(GetUserDetailsRequest getUserDetailsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetUserDetailsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUserDetailsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getUserDetailsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUserDetails"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetUserDetails").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(getUserDetailsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetUserDetailsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about a workflow. *

* * @param getWorkflowRequest * @return Result of the GetWorkflow operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetWorkflow * @see AWS API * Documentation */ @Override public GetWorkflowResponse getWorkflow(GetWorkflowRequest getWorkflowRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetWorkflow"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetWorkflow").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).credentialType(CredentialType.TOKEN) .withRequestConfiguration(clientConfiguration).withInput(getWorkflowRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetWorkflowRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns information about a specified run of a workflow. *

* * @param getWorkflowRunRequest * @return Result of the GetWorkflowRun operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.GetWorkflowRun * @see AWS * API Documentation */ @Override public GetWorkflowRunResponse getWorkflowRun(GetWorkflowRunRequest getWorkflowRunRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetWorkflowRunResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getWorkflowRunRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getWorkflowRunRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetWorkflowRun"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetWorkflowRun").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(getWorkflowRunRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetWorkflowRunRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Lists all personal access tokens (PATs) associated with the user who calls the API. You can only list PATs * associated with your Amazon Web Services Builder ID. *

* * @param listAccessTokensRequest * @return Result of the ListAccessTokens operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListAccessTokens * @see AWS * API Documentation */ @Override public ListAccessTokensResponse listAccessTokens(ListAccessTokensRequest listAccessTokensRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListAccessTokensResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAccessTokensRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAccessTokensRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAccessTokens"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListAccessTokens").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listAccessTokensRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListAccessTokensRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of active sessions for a Dev Environment in a project. *

* * @param listDevEnvironmentSessionsRequest * @return Result of the ListDevEnvironmentSessions operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListDevEnvironmentSessions * @see AWS API Documentation */ @Override public ListDevEnvironmentSessionsResponse listDevEnvironmentSessions( ListDevEnvironmentSessionsRequest listDevEnvironmentSessionsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListDevEnvironmentSessionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDevEnvironmentSessionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDevEnvironmentSessionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDevEnvironmentSessions"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListDevEnvironmentSessions").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listDevEnvironmentSessionsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDevEnvironmentSessionsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of Dev Environments in a project. *

* * @param listDevEnvironmentsRequest * @return Result of the ListDevEnvironments operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListDevEnvironments * @see AWS API Documentation */ @Override public ListDevEnvironmentsResponse listDevEnvironments(ListDevEnvironmentsRequest listDevEnvironmentsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListDevEnvironmentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDevEnvironmentsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listDevEnvironmentsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDevEnvironments"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListDevEnvironments").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listDevEnvironmentsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListDevEnvironmentsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of events that occurred during a specific time in a space. You can use these events to audit * user and system activity in a space. For more information, see Monitoring in the * Amazon CodeCatalyst User Guide. *

* *

* ListEventLogs guarantees events for the last 30 days in a given space. You can also view and retrieve a list of * management events over the last 90 days for Amazon CodeCatalyst in the CloudTrail console by viewing Event * history, or by creating a trail to create and maintain a record of events that extends past 90 days. For more * information, see Working with * CloudTrail Event History and Working with * CloudTrail trails. *

*
* * @param listEventLogsRequest * @return Result of the ListEventLogs operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListEventLogs * @see AWS * API Documentation */ @Override public ListEventLogsResponse listEventLogs(ListEventLogsRequest listEventLogsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListEventLogsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEventLogsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listEventLogsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEventLogs"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListEventLogs").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listEventLogsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListEventLogsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of projects. *

* * @param listProjectsRequest * @return Result of the ListProjects operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListProjects * @see AWS API * Documentation */ @Override public ListProjectsResponse listProjects(ListProjectsRequest listProjectsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListProjectsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listProjectsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listProjectsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProjects"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListProjects").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listProjectsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListProjectsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of source repositories in a project. *

* * @param listSourceRepositoriesRequest * @return Result of the ListSourceRepositories operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListSourceRepositories * @see AWS API Documentation */ @Override public ListSourceRepositoriesResponse listSourceRepositories(ListSourceRepositoriesRequest listSourceRepositoriesRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSourceRepositoriesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSourceRepositoriesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSourceRepositoriesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSourceRepositories"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSourceRepositories").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listSourceRepositoriesRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSourceRepositoriesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of branches in a specified source repository. *

* * @param listSourceRepositoryBranchesRequest * @return Result of the ListSourceRepositoryBranches operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListSourceRepositoryBranches * @see AWS API Documentation */ @Override public ListSourceRepositoryBranchesResponse listSourceRepositoryBranches( ListSourceRepositoryBranchesRequest listSourceRepositoryBranchesRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSourceRepositoryBranchesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSourceRepositoryBranchesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSourceRepositoryBranchesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSourceRepositoryBranches"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSourceRepositoryBranches").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listSourceRepositoryBranchesRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSourceRepositoryBranchesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of spaces. *

* * @param listSpacesRequest * @return Result of the ListSpaces operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListSpaces * @see AWS API * Documentation */ @Override public ListSpacesResponse listSpaces(ListSpacesRequest listSpacesRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListSpacesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSpacesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSpacesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSpaces"); return clientHandler .execute(new ClientExecutionParams().withOperationName("ListSpaces") .withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).credentialType(CredentialType.TOKEN) .withRequestConfiguration(clientConfiguration).withInput(listSpacesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSpacesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of workflow runs of a specified workflow. *

* * @param listWorkflowRunsRequest * @return Result of the ListWorkflowRuns operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListWorkflowRuns * @see AWS * API Documentation */ @Override public ListWorkflowRunsResponse listWorkflowRuns(ListWorkflowRunsRequest listWorkflowRunsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListWorkflowRunsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listWorkflowRunsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listWorkflowRunsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListWorkflowRuns"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListWorkflowRuns").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listWorkflowRunsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListWorkflowRunsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves a list of workflows in a specified project. *

* * @param listWorkflowsRequest * @return Result of the ListWorkflows operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.ListWorkflows * @see AWS * API Documentation */ @Override public ListWorkflowsResponse listWorkflows(ListWorkflowsRequest listWorkflowsRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListWorkflowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listWorkflowsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listWorkflowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListWorkflows"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListWorkflows").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(listWorkflowsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListWorkflowsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts a specified Dev Environment and puts it into an active state. *

* * @param startDevEnvironmentRequest * @return Result of the StartDevEnvironment operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.StartDevEnvironment * @see AWS API Documentation */ @Override public StartDevEnvironmentResponse startDevEnvironment(StartDevEnvironmentRequest startDevEnvironmentRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartDevEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDevEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startDevEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDevEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartDevEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(startDevEnvironmentRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartDevEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts a session for a specified Dev Environment. *

* * @param startDevEnvironmentSessionRequest * @return Result of the StartDevEnvironmentSession operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.StartDevEnvironmentSession * @see AWS API Documentation */ @Override public StartDevEnvironmentSessionResponse startDevEnvironmentSession( StartDevEnvironmentSessionRequest startDevEnvironmentSessionRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartDevEnvironmentSessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDevEnvironmentSessionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startDevEnvironmentSessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDevEnvironmentSession"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("StartDevEnvironmentSession").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(startDevEnvironmentSessionRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartDevEnvironmentSessionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Begins a run of a specified workflow. *

* * @param startWorkflowRunRequest * @return Result of the StartWorkflowRun operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.StartWorkflowRun * @see AWS * API Documentation */ @Override public StartWorkflowRunResponse startWorkflowRun(StartWorkflowRunRequest startWorkflowRunRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartWorkflowRunResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startWorkflowRunRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startWorkflowRunRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartWorkflowRun"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartWorkflowRun").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(startWorkflowRunRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartWorkflowRunRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Pauses a specified Dev Environment and places it in a non-running state. Stopped Dev Environments do not consume * compute minutes. *

* * @param stopDevEnvironmentRequest * @return Result of the StopDevEnvironment operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.StopDevEnvironment * @see AWS API Documentation */ @Override public StopDevEnvironmentResponse stopDevEnvironment(StopDevEnvironmentRequest stopDevEnvironmentRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopDevEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopDevEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopDevEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopDevEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StopDevEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(stopDevEnvironmentRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopDevEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stops a session for a specified Dev Environment. *

* * @param stopDevEnvironmentSessionRequest * @return Result of the StopDevEnvironmentSession operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.StopDevEnvironmentSession * @see AWS API Documentation */ @Override public StopDevEnvironmentSessionResponse stopDevEnvironmentSession( StopDevEnvironmentSessionRequest stopDevEnvironmentSessionRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopDevEnvironmentSessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopDevEnvironmentSessionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopDevEnvironmentSessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopDevEnvironmentSession"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("StopDevEnvironmentSession").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(stopDevEnvironmentSessionRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopDevEnvironmentSessionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Changes one or more values for a Dev Environment. Updating certain values of the Dev Environment will cause a * restart. *

* * @param updateDevEnvironmentRequest * @return Result of the UpdateDevEnvironment operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.UpdateDevEnvironment * @see AWS API Documentation */ @Override public UpdateDevEnvironmentResponse updateDevEnvironment(UpdateDevEnvironmentRequest updateDevEnvironmentRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDevEnvironmentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDevEnvironmentRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDevEnvironmentRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDevEnvironment"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateDevEnvironment").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(updateDevEnvironmentRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateDevEnvironmentRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Changes one or more values for a project. *

* * @param updateProjectRequest * @return Result of the UpdateProject operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.UpdateProject * @see AWS * API Documentation */ @Override public UpdateProjectResponse updateProject(UpdateProjectRequest updateProjectRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateProjectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateProjectRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateProjectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(updateProjectRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Changes one or more values for a space. *

* * @param updateSpaceRequest * @return Result of the UpdateSpace operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.UpdateSpace * @see AWS API * Documentation */ @Override public UpdateSpaceResponse updateSpace(UpdateSpaceRequest updateSpaceRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateSpaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSpaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSpaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSpace"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateSpace").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).credentialType(CredentialType.TOKEN) .withRequestConfiguration(clientConfiguration).withInput(updateSpaceRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateSpaceRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Verifies whether the calling user has a valid Amazon CodeCatalyst login and session. If successful, this returns * the ID of the user in Amazon CodeCatalyst. *

* * @param verifySessionRequest * @return Result of the VerifySession operation returned by the service. * @throws ThrottlingException * The request was denied due to request throttling. * @throws ConflictException * The request was denied because the requested operation would cause a conflict with the current state of a * service resource associated with the request. Another user might have updated the resource. Reload, make * sure you have the latest data, and then try again. * @throws ValidationException * The request was denied because an input failed to satisfy the constraints specified by the service. Check * the spelling and input requirements, and then try again. * @throws ServiceQuotaExceededException * The request was denied because one or more resources has reached its limits for the tier the space * belongs to. Either reduce the number of resources, or change the tier if applicable. * @throws ResourceNotFoundException * The request was denied because the specified resource was not found. Verify that the spelling is correct * and that you have access to the resource. * @throws AccessDeniedException * The request was denied because you don't have sufficient access to perform this action. Verify that you * are a member of a role that allows this action. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for * catch all scenarios. * @throws SdkClientException * If any client side error occurs such as an IO related failure, failure to get credentials, etc. * @throws CodeCatalystException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeCatalystClient.VerifySession * @see AWS * API Documentation */ @Override public VerifySessionResponse verifySession(VerifySessionRequest verifySessionRequest) throws ThrottlingException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, AccessDeniedException, AwsServiceException, SdkClientException, CodeCatalystException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, VerifySessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(verifySessionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, verifySessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeCatalyst"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "VerifySession"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("VerifySession").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .credentialType(CredentialType.TOKEN).withRequestConfiguration(clientConfiguration) .withInput(verifySessionRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new VerifySessionRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } @Override public final String serviceName() { return SERVICE_NAME; } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } CodeCatalystServiceClientConfigurationBuilder serviceConfigBuilder = new CodeCatalystServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(CodeCatalystException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()); } @Override public final CodeCatalystServiceClientConfiguration serviceClientConfiguration() { return new CodeCatalystServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy