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

software.amazon.awssdk.services.codebuild.DefaultCodeBuildClient Maven / Gradle / Ivy

Go to download

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

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

import java.util.Collections;
import java.util.List;
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.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
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.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.services.codebuild.internal.CodeBuildServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.codebuild.model.AccountLimitExceededException;
import software.amazon.awssdk.services.codebuild.model.BatchDeleteBuildsRequest;
import software.amazon.awssdk.services.codebuild.model.BatchDeleteBuildsResponse;
import software.amazon.awssdk.services.codebuild.model.BatchGetBuildBatchesRequest;
import software.amazon.awssdk.services.codebuild.model.BatchGetBuildBatchesResponse;
import software.amazon.awssdk.services.codebuild.model.BatchGetBuildsRequest;
import software.amazon.awssdk.services.codebuild.model.BatchGetBuildsResponse;
import software.amazon.awssdk.services.codebuild.model.BatchGetProjectsRequest;
import software.amazon.awssdk.services.codebuild.model.BatchGetProjectsResponse;
import software.amazon.awssdk.services.codebuild.model.BatchGetReportGroupsRequest;
import software.amazon.awssdk.services.codebuild.model.BatchGetReportGroupsResponse;
import software.amazon.awssdk.services.codebuild.model.BatchGetReportsRequest;
import software.amazon.awssdk.services.codebuild.model.BatchGetReportsResponse;
import software.amazon.awssdk.services.codebuild.model.CodeBuildException;
import software.amazon.awssdk.services.codebuild.model.CreateProjectRequest;
import software.amazon.awssdk.services.codebuild.model.CreateProjectResponse;
import software.amazon.awssdk.services.codebuild.model.CreateReportGroupRequest;
import software.amazon.awssdk.services.codebuild.model.CreateReportGroupResponse;
import software.amazon.awssdk.services.codebuild.model.CreateWebhookRequest;
import software.amazon.awssdk.services.codebuild.model.CreateWebhookResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteBuildBatchRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteBuildBatchResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteProjectRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteProjectResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteReportGroupRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteReportGroupResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteReportRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteReportResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteSourceCredentialsRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteSourceCredentialsResponse;
import software.amazon.awssdk.services.codebuild.model.DeleteWebhookRequest;
import software.amazon.awssdk.services.codebuild.model.DeleteWebhookResponse;
import software.amazon.awssdk.services.codebuild.model.DescribeCodeCoveragesRequest;
import software.amazon.awssdk.services.codebuild.model.DescribeCodeCoveragesResponse;
import software.amazon.awssdk.services.codebuild.model.DescribeTestCasesRequest;
import software.amazon.awssdk.services.codebuild.model.DescribeTestCasesResponse;
import software.amazon.awssdk.services.codebuild.model.GetReportGroupTrendRequest;
import software.amazon.awssdk.services.codebuild.model.GetReportGroupTrendResponse;
import software.amazon.awssdk.services.codebuild.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.codebuild.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.codebuild.model.ImportSourceCredentialsRequest;
import software.amazon.awssdk.services.codebuild.model.ImportSourceCredentialsResponse;
import software.amazon.awssdk.services.codebuild.model.InvalidInputException;
import software.amazon.awssdk.services.codebuild.model.InvalidateProjectCacheRequest;
import software.amazon.awssdk.services.codebuild.model.InvalidateProjectCacheResponse;
import software.amazon.awssdk.services.codebuild.model.ListBuildBatchesForProjectRequest;
import software.amazon.awssdk.services.codebuild.model.ListBuildBatchesForProjectResponse;
import software.amazon.awssdk.services.codebuild.model.ListBuildBatchesRequest;
import software.amazon.awssdk.services.codebuild.model.ListBuildBatchesResponse;
import software.amazon.awssdk.services.codebuild.model.ListBuildsForProjectRequest;
import software.amazon.awssdk.services.codebuild.model.ListBuildsForProjectResponse;
import software.amazon.awssdk.services.codebuild.model.ListBuildsRequest;
import software.amazon.awssdk.services.codebuild.model.ListBuildsResponse;
import software.amazon.awssdk.services.codebuild.model.ListCuratedEnvironmentImagesRequest;
import software.amazon.awssdk.services.codebuild.model.ListCuratedEnvironmentImagesResponse;
import software.amazon.awssdk.services.codebuild.model.ListProjectsRequest;
import software.amazon.awssdk.services.codebuild.model.ListProjectsResponse;
import software.amazon.awssdk.services.codebuild.model.ListReportGroupsRequest;
import software.amazon.awssdk.services.codebuild.model.ListReportGroupsResponse;
import software.amazon.awssdk.services.codebuild.model.ListReportsForReportGroupRequest;
import software.amazon.awssdk.services.codebuild.model.ListReportsForReportGroupResponse;
import software.amazon.awssdk.services.codebuild.model.ListReportsRequest;
import software.amazon.awssdk.services.codebuild.model.ListReportsResponse;
import software.amazon.awssdk.services.codebuild.model.ListSharedProjectsRequest;
import software.amazon.awssdk.services.codebuild.model.ListSharedProjectsResponse;
import software.amazon.awssdk.services.codebuild.model.ListSharedReportGroupsRequest;
import software.amazon.awssdk.services.codebuild.model.ListSharedReportGroupsResponse;
import software.amazon.awssdk.services.codebuild.model.ListSourceCredentialsRequest;
import software.amazon.awssdk.services.codebuild.model.ListSourceCredentialsResponse;
import software.amazon.awssdk.services.codebuild.model.OAuthProviderException;
import software.amazon.awssdk.services.codebuild.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.codebuild.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.codebuild.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.codebuild.model.ResourceNotFoundException;
import software.amazon.awssdk.services.codebuild.model.RetryBuildBatchRequest;
import software.amazon.awssdk.services.codebuild.model.RetryBuildBatchResponse;
import software.amazon.awssdk.services.codebuild.model.RetryBuildRequest;
import software.amazon.awssdk.services.codebuild.model.RetryBuildResponse;
import software.amazon.awssdk.services.codebuild.model.StartBuildBatchRequest;
import software.amazon.awssdk.services.codebuild.model.StartBuildBatchResponse;
import software.amazon.awssdk.services.codebuild.model.StartBuildRequest;
import software.amazon.awssdk.services.codebuild.model.StartBuildResponse;
import software.amazon.awssdk.services.codebuild.model.StopBuildBatchRequest;
import software.amazon.awssdk.services.codebuild.model.StopBuildBatchResponse;
import software.amazon.awssdk.services.codebuild.model.StopBuildRequest;
import software.amazon.awssdk.services.codebuild.model.StopBuildResponse;
import software.amazon.awssdk.services.codebuild.model.UpdateProjectRequest;
import software.amazon.awssdk.services.codebuild.model.UpdateProjectResponse;
import software.amazon.awssdk.services.codebuild.model.UpdateProjectVisibilityRequest;
import software.amazon.awssdk.services.codebuild.model.UpdateProjectVisibilityResponse;
import software.amazon.awssdk.services.codebuild.model.UpdateReportGroupRequest;
import software.amazon.awssdk.services.codebuild.model.UpdateReportGroupResponse;
import software.amazon.awssdk.services.codebuild.model.UpdateWebhookRequest;
import software.amazon.awssdk.services.codebuild.model.UpdateWebhookResponse;
import software.amazon.awssdk.services.codebuild.transform.BatchDeleteBuildsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.BatchGetBuildBatchesRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.BatchGetBuildsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.BatchGetProjectsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.BatchGetReportGroupsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.BatchGetReportsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.CreateProjectRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.CreateReportGroupRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.CreateWebhookRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteBuildBatchRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteProjectRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteReportGroupRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteReportRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteSourceCredentialsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DeleteWebhookRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DescribeCodeCoveragesRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.DescribeTestCasesRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.GetReportGroupTrendRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.GetResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ImportSourceCredentialsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.InvalidateProjectCacheRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListBuildBatchesForProjectRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListBuildBatchesRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListBuildsForProjectRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListBuildsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListCuratedEnvironmentImagesRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListProjectsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListReportGroupsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListReportsForReportGroupRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListReportsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListSharedProjectsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListSharedReportGroupsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.ListSourceCredentialsRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.RetryBuildBatchRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.RetryBuildRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.StartBuildBatchRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.StartBuildRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.StopBuildBatchRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.StopBuildRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.UpdateProjectRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.UpdateProjectVisibilityRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.UpdateReportGroupRequestMarshaller;
import software.amazon.awssdk.services.codebuild.transform.UpdateWebhookRequestMarshaller;
import software.amazon.awssdk.utils.Logger;

/**
 * Internal implementation of {@link CodeBuildClient}.
 *
 * @see CodeBuildClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultCodeBuildClient implements CodeBuildClient {
    private static final Logger log = Logger.loggerFor(DefaultCodeBuildClient.class);

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.AWS_JSON).build();

    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultCodeBuildClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Deletes one or more builds. *

* * @param batchDeleteBuildsRequest * @return Result of the BatchDeleteBuilds operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.BatchDeleteBuilds * @see AWS * API Documentation */ @Override public BatchDeleteBuildsResponse batchDeleteBuilds(BatchDeleteBuildsRequest batchDeleteBuildsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, BatchDeleteBuildsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchDeleteBuildsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDeleteBuildsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDeleteBuilds"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchDeleteBuilds").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(batchDeleteBuildsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchDeleteBuildsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves information about one or more batch builds. *

* * @param batchGetBuildBatchesRequest * @return Result of the BatchGetBuildBatches operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.BatchGetBuildBatches * @see AWS API Documentation */ @Override public BatchGetBuildBatchesResponse batchGetBuildBatches(BatchGetBuildBatchesRequest batchGetBuildBatchesRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchGetBuildBatchesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetBuildBatchesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetBuildBatchesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetBuildBatches"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchGetBuildBatches").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(batchGetBuildBatchesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchGetBuildBatchesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets information about one or more builds. *

* * @param batchGetBuildsRequest * @return Result of the BatchGetBuilds operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.BatchGetBuilds * @see AWS API * Documentation */ @Override public BatchGetBuildsResponse batchGetBuilds(BatchGetBuildsRequest batchGetBuildsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, BatchGetBuildsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetBuildsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetBuildsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetBuilds"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchGetBuilds").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(batchGetBuildsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchGetBuildsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets information about one or more build projects. *

* * @param batchGetProjectsRequest * @return Result of the BatchGetProjects operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.BatchGetProjects * @see AWS * API Documentation */ @Override public BatchGetProjectsResponse batchGetProjects(BatchGetProjectsRequest batchGetProjectsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, BatchGetProjectsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetProjectsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetProjectsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetProjects"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchGetProjects").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(batchGetProjectsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchGetProjectsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns an array of report groups. *

* * @param batchGetReportGroupsRequest * @return Result of the BatchGetReportGroups operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.BatchGetReportGroups * @see AWS API Documentation */ @Override public BatchGetReportGroupsResponse batchGetReportGroups(BatchGetReportGroupsRequest batchGetReportGroupsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchGetReportGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetReportGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetReportGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetReportGroups"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchGetReportGroups").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(batchGetReportGroupsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchGetReportGroupsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns an array of reports. *

* * @param batchGetReportsRequest * @return Result of the BatchGetReports operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.BatchGetReports * @see AWS API * Documentation */ @Override public BatchGetReportsResponse batchGetReports(BatchGetReportsRequest batchGetReportsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, BatchGetReportsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetReportsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetReportsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetReports"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("BatchGetReports").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(batchGetReportsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new BatchGetReportsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a build project. *

* * @param createProjectRequest * @return Result of the CreateProject operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceAlreadyExistsException * The specified Amazon Web Services resource cannot be created, because an Amazon Web Services resource * with the same settings already exists. * @throws AccountLimitExceededException * An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.CreateProject * @see AWS API * Documentation */ @Override public CreateProjectResponse createProject(CreateProjectRequest createProjectRequest) throws InvalidInputException, ResourceAlreadyExistsException, AccountLimitExceededException, AwsServiceException, SdkClientException, CodeBuildException { 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, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createProjectRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Creates a report group. A report group contains a collection of reports. *

* * @param createReportGroupRequest * @return Result of the CreateReportGroup operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceAlreadyExistsException * The specified Amazon Web Services resource cannot be created, because an Amazon Web Services resource * with the same settings already exists. * @throws AccountLimitExceededException * An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.CreateReportGroup * @see AWS * API Documentation */ @Override public CreateReportGroupResponse createReportGroup(CreateReportGroupRequest createReportGroupRequest) throws InvalidInputException, ResourceAlreadyExistsException, AccountLimitExceededException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateReportGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createReportGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createReportGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReportGroup"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateReportGroup").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createReportGroupRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateReportGroupRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* For an existing CodeBuild build project that has its source code stored in a GitHub or Bitbucket repository, * enables CodeBuild to start rebuilding the source code every time a code change is pushed to the repository. *

* *

* If you enable webhooks for an CodeBuild project, and the project is used as a build step in CodePipeline, then * two identical builds are created for each commit. One build is triggered through webhooks, and one through * CodePipeline. Because billing is on a per-build basis, you are billed for both builds. Therefore, if you are * using CodePipeline, we recommend that you disable webhooks in CodeBuild. In the CodeBuild console, clear the * Webhook box. For more information, see step 5 in Change a * Build Project's Settings. *

*
* * @param createWebhookRequest * @return Result of the CreateWebhook operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws OAuthProviderException * There was a problem with the underlying OAuth provider. * @throws ResourceAlreadyExistsException * The specified Amazon Web Services resource cannot be created, because an Amazon Web Services resource * with the same settings already exists. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.CreateWebhook * @see AWS API * Documentation */ @Override public CreateWebhookResponse createWebhook(CreateWebhookRequest createWebhookRequest) throws InvalidInputException, OAuthProviderException, ResourceAlreadyExistsException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateWebhookResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createWebhookRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createWebhookRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateWebhook"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("CreateWebhook").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(createWebhookRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new CreateWebhookRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a batch build. *

* * @param deleteBuildBatchRequest * @return Result of the DeleteBuildBatch operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteBuildBatch * @see AWS * API Documentation */ @Override public DeleteBuildBatchResponse deleteBuildBatch(DeleteBuildBatchRequest deleteBuildBatchRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteBuildBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteBuildBatchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteBuildBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteBuildBatch"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteBuildBatch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteBuildBatchRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteBuildBatchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a build project. When you delete a project, its builds are not deleted. *

* * @param deleteProjectRequest * @return Result of the DeleteProject operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteProject * @see AWS API * Documentation */ @Override public DeleteProjectResponse deleteProject(DeleteProjectRequest deleteProjectRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { 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, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteProjectRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a report. *

* * @param deleteReportRequest * @return Result of the DeleteReport operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteReport * @see AWS API * Documentation */ @Override public DeleteReportResponse deleteReport(DeleteReportRequest deleteReportRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteReportResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReportRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReportRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReport"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteReport").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteReportRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteReportRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a report group. Before you delete a report group, you must delete its reports. *

* * @param deleteReportGroupRequest * @return Result of the DeleteReportGroup operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteReportGroup * @see AWS * API Documentation */ @Override public DeleteReportGroupResponse deleteReportGroup(DeleteReportGroupRequest deleteReportGroupRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteReportGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteReportGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReportGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReportGroup"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteReportGroup").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteReportGroupRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteReportGroupRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a resource policy that is identified by its resource ARN. *

* * @param deleteResourcePolicyRequest * @return Result of the DeleteResourcePolicy operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteResourcePolicy * @see AWS API Documentation */ @Override public DeleteResourcePolicyResponse deleteResourcePolicy(DeleteResourcePolicyRequest deleteResourcePolicyRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteResourcePolicyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Deletes a set of GitHub, GitHub Enterprise, or Bitbucket source credentials. *

* * @param deleteSourceCredentialsRequest * @return Result of the DeleteSourceCredentials operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteSourceCredentials * @see AWS API Documentation */ @Override public DeleteSourceCredentialsResponse deleteSourceCredentials(DeleteSourceCredentialsRequest deleteSourceCredentialsRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSourceCredentialsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSourceCredentialsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSourceCredentialsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSourceCredentials"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSourceCredentials").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteSourceCredentialsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteSourceCredentialsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* For an existing CodeBuild build project that has its source code stored in a GitHub or Bitbucket repository, * stops CodeBuild from rebuilding the source code every time a code change is pushed to the repository. *

* * @param deleteWebhookRequest * @return Result of the DeleteWebhook operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @throws OAuthProviderException * There was a problem with the underlying OAuth provider. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DeleteWebhook * @see AWS API * Documentation */ @Override public DeleteWebhookResponse deleteWebhook(DeleteWebhookRequest deleteWebhookRequest) throws InvalidInputException, ResourceNotFoundException, OAuthProviderException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteWebhookResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteWebhookRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteWebhookRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteWebhook"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DeleteWebhook").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(deleteWebhookRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DeleteWebhookRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves one or more code coverage reports. *

* * @param describeCodeCoveragesRequest * @return Result of the DescribeCodeCoverages operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DescribeCodeCoverages * @see AWS API Documentation */ @Override public DescribeCodeCoveragesResponse describeCodeCoverages(DescribeCodeCoveragesRequest describeCodeCoveragesRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCodeCoveragesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCodeCoveragesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCodeCoveragesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCodeCoverages"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeCodeCoverages").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeCodeCoveragesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeCodeCoveragesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of details about test cases for a report. *

* * @param describeTestCasesRequest * @return Result of the DescribeTestCases operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.DescribeTestCases * @see AWS * API Documentation */ @Override public DescribeTestCasesResponse describeTestCases(DescribeTestCasesRequest describeTestCasesRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeTestCasesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeTestCasesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeTestCasesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTestCases"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("DescribeTestCases").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(describeTestCasesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new DescribeTestCasesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Analyzes and accumulates test report values for the specified test reports. *

* * @param getReportGroupTrendRequest * @return Result of the GetReportGroupTrend operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.GetReportGroupTrend * @see AWS * API Documentation */ @Override public GetReportGroupTrendResponse getReportGroupTrend(GetReportGroupTrendRequest getReportGroupTrendRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetReportGroupTrendResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getReportGroupTrendRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getReportGroupTrendRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReportGroupTrend"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetReportGroupTrend").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getReportGroupTrendRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetReportGroupTrendRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a resource policy that is identified by its resource ARN. *

* * @param getResourcePolicyRequest * @return Result of the GetResourcePolicy operation returned by the service. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.GetResourcePolicy * @see AWS * API Documentation */ @Override public GetResourcePolicyResponse getResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest) throws ResourceNotFoundException, InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourcePolicy"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("GetResourcePolicy").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(getResourcePolicyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new GetResourcePolicyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Imports the source repository credentials for an CodeBuild project that has its source code stored in a GitHub, * GitHub Enterprise, or Bitbucket repository. *

* * @param importSourceCredentialsRequest * @return Result of the ImportSourceCredentials operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws AccountLimitExceededException * An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account. * @throws ResourceAlreadyExistsException * The specified Amazon Web Services resource cannot be created, because an Amazon Web Services resource * with the same settings already exists. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ImportSourceCredentials * @see AWS API Documentation */ @Override public ImportSourceCredentialsResponse importSourceCredentials(ImportSourceCredentialsRequest importSourceCredentialsRequest) throws InvalidInputException, AccountLimitExceededException, ResourceAlreadyExistsException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ImportSourceCredentialsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(importSourceCredentialsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, importSourceCredentialsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportSourceCredentials"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ImportSourceCredentials").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(importSourceCredentialsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ImportSourceCredentialsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Resets the cache for a project. *

* * @param invalidateProjectCacheRequest * @return Result of the InvalidateProjectCache operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.InvalidateProjectCache * @see AWS API Documentation */ @Override public InvalidateProjectCacheResponse invalidateProjectCache(InvalidateProjectCacheRequest invalidateProjectCacheRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, InvalidateProjectCacheResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(invalidateProjectCacheRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, invalidateProjectCacheRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "InvalidateProjectCache"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("InvalidateProjectCache").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(invalidateProjectCacheRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new InvalidateProjectCacheRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the identifiers of your build batches in the current region. *

* * @param listBuildBatchesRequest * @return Result of the ListBuildBatches operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListBuildBatches * @see AWS * API Documentation */ @Override public ListBuildBatchesResponse listBuildBatches(ListBuildBatchesRequest listBuildBatchesRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListBuildBatchesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBuildBatchesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBuildBatchesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBuildBatches"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListBuildBatches").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listBuildBatchesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBuildBatchesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Retrieves the identifiers of the build batches for a specific project. *

* * @param listBuildBatchesForProjectRequest * @return Result of the ListBuildBatchesForProject operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListBuildBatchesForProject * @see AWS API Documentation */ @Override public ListBuildBatchesForProjectResponse listBuildBatchesForProject( ListBuildBatchesForProjectRequest listBuildBatchesForProjectRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListBuildBatchesForProjectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBuildBatchesForProjectRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBuildBatchesForProjectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBuildBatchesForProject"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListBuildBatchesForProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listBuildBatchesForProjectRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBuildBatchesForProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a list of build IDs, with each build ID representing a single build. *

* * @param listBuildsRequest * @return Result of the ListBuilds operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListBuilds * @see AWS API * Documentation */ @Override public ListBuildsResponse listBuilds(ListBuildsRequest listBuildsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListBuildsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBuildsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBuildsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBuilds"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListBuilds").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(listBuildsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBuildsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a list of build identifiers for the specified build project, with each build identifier representing a * single build. *

* * @param listBuildsForProjectRequest * @return Result of the ListBuildsForProject operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListBuildsForProject * @see AWS API Documentation */ @Override public ListBuildsForProjectResponse listBuildsForProject(ListBuildsForProjectRequest listBuildsForProjectRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListBuildsForProjectResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listBuildsForProjectRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listBuildsForProjectRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListBuildsForProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListBuildsForProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listBuildsForProjectRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListBuildsForProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets information about Docker images that are managed by CodeBuild. *

* * @param listCuratedEnvironmentImagesRequest * @return Result of the ListCuratedEnvironmentImages operation returned by the service. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListCuratedEnvironmentImages * @see AWS API Documentation */ @Override public ListCuratedEnvironmentImagesResponse listCuratedEnvironmentImages( ListCuratedEnvironmentImagesRequest listCuratedEnvironmentImagesRequest) throws AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCuratedEnvironmentImagesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCuratedEnvironmentImagesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCuratedEnvironmentImagesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCuratedEnvironmentImages"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCuratedEnvironmentImages").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listCuratedEnvironmentImagesRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListCuratedEnvironmentImagesRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a list of build project names, with each build project name representing a single build project. *

* * @param listProjectsRequest * @return Result of the ListProjects operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListProjects * @see AWS API * Documentation */ @Override public ListProjectsResponse listProjects(ListProjectsRequest listProjectsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { 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, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProjects"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListProjects").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listProjectsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListProjectsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a list ARNs for the report groups in the current Amazon Web Services account. *

* * @param listReportGroupsRequest * @return Result of the ListReportGroups operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListReportGroups * @see AWS * API Documentation */ @Override public ListReportGroupsResponse listReportGroups(ListReportGroupsRequest listReportGroupsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListReportGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listReportGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listReportGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListReportGroups"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListReportGroups").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listReportGroupsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListReportGroupsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of ARNs for the reports in the current Amazon Web Services account. *

* * @param listReportsRequest * @return Result of the ListReports operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListReports * @see AWS API * Documentation */ @Override public ListReportsResponse listReports(ListReportsRequest listReportsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListReportsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listReportsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listReportsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListReports"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListReports").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(listReportsRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListReportsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of ARNs for the reports that belong to a ReportGroup. *

* * @param listReportsForReportGroupRequest * @return Result of the ListReportsForReportGroup operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListReportsForReportGroup * @see AWS API Documentation */ @Override public ListReportsForReportGroupResponse listReportsForReportGroup( ListReportsForReportGroupRequest listReportsForReportGroupRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListReportsForReportGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listReportsForReportGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listReportsForReportGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListReportsForReportGroup"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListReportsForReportGroup").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listReportsForReportGroupRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListReportsForReportGroupRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a list of projects that are shared with other Amazon Web Services accounts or users. *

* * @param listSharedProjectsRequest * @return Result of the ListSharedProjects operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListSharedProjects * @see AWS * API Documentation */ @Override public ListSharedProjectsResponse listSharedProjects(ListSharedProjectsRequest listSharedProjectsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSharedProjectsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSharedProjectsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSharedProjectsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSharedProjects"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListSharedProjects").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listSharedProjectsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSharedProjectsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Gets a list of report groups that are shared with other Amazon Web Services accounts or users. *

* * @param listSharedReportGroupsRequest * @return Result of the ListSharedReportGroups operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListSharedReportGroups * @see AWS API Documentation */ @Override public ListSharedReportGroupsResponse listSharedReportGroups(ListSharedReportGroupsRequest listSharedReportGroupsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSharedReportGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSharedReportGroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSharedReportGroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSharedReportGroups"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSharedReportGroups").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listSharedReportGroupsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSharedReportGroupsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Returns a list of SourceCredentialsInfo objects. *

* * @param listSourceCredentialsRequest * @return Result of the ListSourceCredentials operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.ListSourceCredentials * @see AWS API Documentation */ @Override public ListSourceCredentialsResponse listSourceCredentials(ListSourceCredentialsRequest listSourceCredentialsRequest) throws InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSourceCredentialsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSourceCredentialsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSourceCredentialsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSourceCredentials"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListSourceCredentials").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(listSourceCredentialsRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new ListSourceCredentialsRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stores a resource policy for the ARN of a Project or ReportGroup object. *

* * @param putResourcePolicyRequest * @return Result of the PutResourcePolicy operation returned by the service. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @throws InvalidInputException * The input value that was provided is not valid. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.PutResourcePolicy * @see AWS * API Documentation */ @Override public PutResourcePolicyResponse putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) throws ResourceNotFoundException, InvalidInputException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourcePolicy"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("PutResourcePolicy").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(putResourcePolicyRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new PutResourcePolicyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Restarts a build. *

* * @param retryBuildRequest * @return Result of the RetryBuild operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @throws AccountLimitExceededException * An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.RetryBuild * @see AWS API * Documentation */ @Override public RetryBuildResponse retryBuild(RetryBuildRequest retryBuildRequest) throws InvalidInputException, ResourceNotFoundException, AccountLimitExceededException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, RetryBuildResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(retryBuildRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, retryBuildRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RetryBuild"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RetryBuild").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(retryBuildRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new RetryBuildRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Restarts a failed batch build. Only batch builds that have failed can be retried. *

* * @param retryBuildBatchRequest * @return Result of the RetryBuildBatch operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.RetryBuildBatch * @see AWS API * Documentation */ @Override public RetryBuildBatchResponse retryBuildBatch(RetryBuildBatchRequest retryBuildBatchRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, RetryBuildBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(retryBuildBatchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, retryBuildBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RetryBuildBatch"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RetryBuildBatch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(retryBuildBatchRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new RetryBuildBatchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts running a build. *

* * @param startBuildRequest * @return Result of the StartBuild operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @throws AccountLimitExceededException * An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.StartBuild * @see AWS API * Documentation */ @Override public StartBuildResponse startBuild(StartBuildRequest startBuildRequest) throws InvalidInputException, ResourceNotFoundException, AccountLimitExceededException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartBuildResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startBuildRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startBuildRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartBuild"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartBuild").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(startBuildRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartBuildRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Starts a batch build for a project. *

* * @param startBuildBatchRequest * @return Result of the StartBuildBatch operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.StartBuildBatch * @see AWS API * Documentation */ @Override public StartBuildBatchResponse startBuildBatch(StartBuildBatchRequest startBuildBatchRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartBuildBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startBuildBatchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startBuildBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartBuildBatch"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartBuildBatch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(startBuildBatchRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StartBuildBatchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Attempts to stop running a build. *

* * @param stopBuildRequest * @return Result of the StopBuild operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.StopBuild * @see AWS API * Documentation */ @Override public StopBuildResponse stopBuild(StopBuildRequest stopBuildRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopBuildResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopBuildRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopBuildRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopBuild"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StopBuild").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withInput(stopBuildRequest).withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopBuildRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Stops a running batch build. *

* * @param stopBuildBatchRequest * @return Result of the StopBuildBatch operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.StopBuildBatch * @see AWS API * Documentation */ @Override public StopBuildBatchResponse stopBuildBatch(StopBuildBatchRequest stopBuildBatchRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopBuildBatchResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopBuildBatchRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopBuildBatchRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopBuildBatch"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StopBuildBatch").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(stopBuildBatchRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new StopBuildBatchRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Changes the settings of a build project. *

* * @param updateProjectRequest * @return Result of the UpdateProject operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.UpdateProject * @see AWS API * Documentation */ @Override public UpdateProjectResponse updateProject(UpdateProjectRequest updateProjectRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { 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, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateProject"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateProject").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateProjectRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateProjectRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Changes the public visibility for a project. The project's build results, logs, and artifacts are available to * the general public. For more information, see Public build projects in the * CodeBuild User Guide. *

* *

* The following should be kept in mind when making your projects public: *

*
    *
  • *

    * All of a project's build results, logs, and artifacts, including builds that were run when the project was * private, are available to the general public. *

    *
  • *
  • *

    * All build logs and artifacts are available to the public. Environment variables, source code, and other sensitive * information may have been output to the build logs and artifacts. You must be careful about what information is * output to the build logs. Some best practice are: *

    *
      *
    • *

      * Do not store sensitive values in environment variables. We recommend that you use an Amazon EC2 Systems Manager * Parameter Store or Secrets Manager to store sensitive values. *

      *
    • *
    • *

      * Follow Best * practices for using webhooks in the CodeBuild User Guide to limit which entities can trigger a build, * and do not store the buildspec in the project itself, to ensure that your webhooks are as secure as possible. *

      *
    • *
    *
  • *
  • *

    * A malicious user can use public builds to distribute malicious artifacts. We recommend that you review all pull * requests to verify that the pull request is a legitimate change. We also recommend that you validate any * artifacts with their checksums to make sure that the correct artifacts are being downloaded. *

    *
  • *
*
* * @param updateProjectVisibilityRequest * @return Result of the UpdateProjectVisibility operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.UpdateProjectVisibility * @see AWS API Documentation */ @Override public UpdateProjectVisibilityResponse updateProjectVisibility(UpdateProjectVisibilityRequest updateProjectVisibilityRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateProjectVisibilityResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateProjectVisibilityRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateProjectVisibilityRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateProjectVisibility"); return clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateProjectVisibility").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateProjectVisibilityRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateProjectVisibilityRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates a report group. *

* * @param updateReportGroupRequest * @return Result of the UpdateReportGroup operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.UpdateReportGroup * @see AWS * API Documentation */ @Override public UpdateReportGroupResponse updateReportGroup(UpdateReportGroupRequest updateReportGroupRequest) throws InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateReportGroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateReportGroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateReportGroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateReportGroup"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateReportGroup").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateReportGroupRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateReportGroupRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } /** *

* Updates the webhook associated with an CodeBuild build project. *

* *

* If you use Bitbucket for your repository, rotateSecret is ignored. *

*
* * @param updateWebhookRequest * @return Result of the UpdateWebhook operation returned by the service. * @throws InvalidInputException * The input value that was provided is not valid. * @throws ResourceNotFoundException * The specified Amazon Web Services resource cannot be found. * @throws OAuthProviderException * There was a problem with the underlying OAuth provider. * @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 CodeBuildException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample CodeBuildClient.UpdateWebhook * @see AWS API * Documentation */ @Override public UpdateWebhookResponse updateWebhook(UpdateWebhookRequest updateWebhookRequest) throws InvalidInputException, ResourceNotFoundException, OAuthProviderException, AwsServiceException, SdkClientException, CodeBuildException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateWebhookResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateWebhookRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateWebhookRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CodeBuild"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateWebhook"); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateWebhook").withProtocolMetadata(protocolMetadata) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withInput(updateWebhookRequest) .withMetricCollector(apiCallMetricCollector) .withMarshaller(new UpdateWebhookRequestMarshaller(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 SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); if (plugins.isEmpty()) { return clientConfiguration; } SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); CodeBuildServiceClientConfigurationBuilder serviceConfigBuilder = new CodeBuildServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } return configuration.build(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(CodeBuildException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("OAuthProviderException") .exceptionBuilderSupplier(OAuthProviderException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidInputException") .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccountLimitExceededException") .exceptionBuilderSupplier(AccountLimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException") .exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).httpStatusCode(400).build()); } @Override public final CodeBuildServiceClientConfiguration serviceClientConfiguration() { return new CodeBuildServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy