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

software.amazon.awssdk.services.mediaconnect.DefaultMediaConnectClient Maven / Gradle / Ivy

Go to download

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

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

import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
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.util.VersionInfo;
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.mediaconnect.model.AddFlowOutputs420Exception;
import software.amazon.awssdk.services.mediaconnect.model.AddFlowOutputsRequest;
import software.amazon.awssdk.services.mediaconnect.model.AddFlowOutputsResponse;
import software.amazon.awssdk.services.mediaconnect.model.AddFlowSourcesRequest;
import software.amazon.awssdk.services.mediaconnect.model.AddFlowSourcesResponse;
import software.amazon.awssdk.services.mediaconnect.model.AddFlowVpcInterfacesRequest;
import software.amazon.awssdk.services.mediaconnect.model.AddFlowVpcInterfacesResponse;
import software.amazon.awssdk.services.mediaconnect.model.BadRequestException;
import software.amazon.awssdk.services.mediaconnect.model.CreateFlow420Exception;
import software.amazon.awssdk.services.mediaconnect.model.CreateFlowRequest;
import software.amazon.awssdk.services.mediaconnect.model.CreateFlowResponse;
import software.amazon.awssdk.services.mediaconnect.model.DeleteFlowRequest;
import software.amazon.awssdk.services.mediaconnect.model.DeleteFlowResponse;
import software.amazon.awssdk.services.mediaconnect.model.DescribeFlowRequest;
import software.amazon.awssdk.services.mediaconnect.model.DescribeFlowResponse;
import software.amazon.awssdk.services.mediaconnect.model.ForbiddenException;
import software.amazon.awssdk.services.mediaconnect.model.GrantFlowEntitlements420Exception;
import software.amazon.awssdk.services.mediaconnect.model.GrantFlowEntitlementsRequest;
import software.amazon.awssdk.services.mediaconnect.model.GrantFlowEntitlementsResponse;
import software.amazon.awssdk.services.mediaconnect.model.InternalServerErrorException;
import software.amazon.awssdk.services.mediaconnect.model.ListEntitlementsRequest;
import software.amazon.awssdk.services.mediaconnect.model.ListEntitlementsResponse;
import software.amazon.awssdk.services.mediaconnect.model.ListFlowsRequest;
import software.amazon.awssdk.services.mediaconnect.model.ListFlowsResponse;
import software.amazon.awssdk.services.mediaconnect.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.mediaconnect.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.mediaconnect.model.MediaConnectException;
import software.amazon.awssdk.services.mediaconnect.model.MediaConnectRequest;
import software.amazon.awssdk.services.mediaconnect.model.NotFoundException;
import software.amazon.awssdk.services.mediaconnect.model.RemoveFlowOutputRequest;
import software.amazon.awssdk.services.mediaconnect.model.RemoveFlowOutputResponse;
import software.amazon.awssdk.services.mediaconnect.model.RemoveFlowSourceRequest;
import software.amazon.awssdk.services.mediaconnect.model.RemoveFlowSourceResponse;
import software.amazon.awssdk.services.mediaconnect.model.RemoveFlowVpcInterfaceRequest;
import software.amazon.awssdk.services.mediaconnect.model.RemoveFlowVpcInterfaceResponse;
import software.amazon.awssdk.services.mediaconnect.model.RevokeFlowEntitlementRequest;
import software.amazon.awssdk.services.mediaconnect.model.RevokeFlowEntitlementResponse;
import software.amazon.awssdk.services.mediaconnect.model.ServiceUnavailableException;
import software.amazon.awssdk.services.mediaconnect.model.StartFlowRequest;
import software.amazon.awssdk.services.mediaconnect.model.StartFlowResponse;
import software.amazon.awssdk.services.mediaconnect.model.StopFlowRequest;
import software.amazon.awssdk.services.mediaconnect.model.StopFlowResponse;
import software.amazon.awssdk.services.mediaconnect.model.TagResourceRequest;
import software.amazon.awssdk.services.mediaconnect.model.TagResourceResponse;
import software.amazon.awssdk.services.mediaconnect.model.TooManyRequestsException;
import software.amazon.awssdk.services.mediaconnect.model.UntagResourceRequest;
import software.amazon.awssdk.services.mediaconnect.model.UntagResourceResponse;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowEntitlementRequest;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowEntitlementResponse;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowOutputRequest;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowOutputResponse;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowRequest;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowResponse;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowSourceRequest;
import software.amazon.awssdk.services.mediaconnect.model.UpdateFlowSourceResponse;
import software.amazon.awssdk.services.mediaconnect.paginators.ListEntitlementsIterable;
import software.amazon.awssdk.services.mediaconnect.paginators.ListFlowsIterable;
import software.amazon.awssdk.services.mediaconnect.transform.AddFlowOutputsRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.AddFlowSourcesRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.AddFlowVpcInterfacesRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.CreateFlowRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.DeleteFlowRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.DescribeFlowRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.GrantFlowEntitlementsRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.ListEntitlementsRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.ListFlowsRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.RemoveFlowOutputRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.RemoveFlowSourceRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.RemoveFlowVpcInterfaceRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.RevokeFlowEntitlementRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.StartFlowRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.StopFlowRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.UpdateFlowEntitlementRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.UpdateFlowOutputRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.UpdateFlowRequestMarshaller;
import software.amazon.awssdk.services.mediaconnect.transform.UpdateFlowSourceRequestMarshaller;

/**
 * Internal implementation of {@link MediaConnectClient}.
 *
 * @see MediaConnectClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultMediaConnectClient implements MediaConnectClient {
    private final SyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * Adds outputs to an existing flow. You can create up to 50 outputs per flow.
     *
     * @param addFlowOutputsRequest
     *        A request to add outputs to the specified flow.
     * @return Result of the AddFlowOutputs operation returned by the service.
     * @throws AddFlowOutputs420Exception
     *         AWS Elemental MediaConnect can't complete this request because this flow already has the maximum number
     *         of allowed outputs (50). For more information, contact AWS Customer Support.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws NotFoundException
     *         AWS Elemental MediaConnect did not find the resource that you specified in the request.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.AddFlowOutputs
     * @see AWS
     *      API Documentation
     */
    @Override
    public AddFlowOutputsResponse addFlowOutputs(AddFlowOutputsRequest addFlowOutputsRequest) throws AddFlowOutputs420Exception,
            BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException,
            ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
                AddFlowOutputsResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("AddFlowOutputs").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(addFlowOutputsRequest)
                .withMarshaller(new AddFlowOutputsRequestMarshaller(protocolFactory)));
    }

    /**
     * Adds Sources to flow
     *
     * @param addFlowSourcesRequest
     *        A request to add sources to the flow.
     * @return Result of the AddFlowSources operation returned by the service.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws NotFoundException
     *         AWS Elemental MediaConnect did not find the resource that you specified in the request.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.AddFlowSources
     * @see AWS
     *      API Documentation
     */
    @Override
    public AddFlowSourcesResponse addFlowSources(AddFlowSourcesRequest addFlowSourcesRequest) throws BadRequestException,
            InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException,
            TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
                AddFlowSourcesResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("AddFlowSources").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(addFlowSourcesRequest)
                .withMarshaller(new AddFlowSourcesRequestMarshaller(protocolFactory)));
    }

    /**
     * Adds VPC interfaces to flow
     *
     * @param addFlowVpcInterfacesRequest
     *        A request to add VPC interfaces to the flow.
     * @return Result of the AddFlowVpcInterfaces operation returned by the service.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws NotFoundException
     *         AWS Elemental MediaConnect did not find the resource that you specified in the request.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.AddFlowVpcInterfaces
     * @see AWS API Documentation
     */
    @Override
    public AddFlowVpcInterfacesResponse addFlowVpcInterfaces(AddFlowVpcInterfacesRequest addFlowVpcInterfacesRequest)
            throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException,
            ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
                operationMetadata, AddFlowVpcInterfacesResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("AddFlowVpcInterfaces").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(addFlowVpcInterfacesRequest)
                .withMarshaller(new AddFlowVpcInterfacesRequestMarshaller(protocolFactory)));
    }

    /**
     * Creates a new flow. The request must include one source. The request optionally can include outputs (up to 50)
     * and entitlements (up to 50).
     *
     * @param createFlowRequest
     *        Creates a new flow. The request must include one source. The request optionally can include outputs (up to
     *        50) and entitlements (up to 50).
     * @return Result of the CreateFlow operation returned by the service.
     * @throws CreateFlow420Exception
     *         Your account already contains the maximum number of 20 flows per account, per Region. For more
     *         information, contact AWS Customer Support.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.CreateFlow
     * @see AWS API
     *      Documentation
     */
    @Override
    public CreateFlowResponse createFlow(CreateFlowRequest createFlowRequest) throws CreateFlow420Exception, BadRequestException,
            InternalServerErrorException, ForbiddenException, ServiceUnavailableException, TooManyRequestsException,
            AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
                CreateFlowResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("CreateFlow").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(createFlowRequest)
                .withMarshaller(new CreateFlowRequestMarshaller(protocolFactory)));
    }

    /**
     * Deletes a flow. Before you can delete a flow, you must stop the flow.
     *
     * @param deleteFlowRequest
     * @return Result of the DeleteFlow operation returned by the service.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws NotFoundException
     *         AWS Elemental MediaConnect did not find the resource that you specified in the request.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.DeleteFlow
     * @see AWS API
     *      Documentation
     */
    @Override
    public DeleteFlowResponse deleteFlow(DeleteFlowRequest deleteFlowRequest) throws BadRequestException,
            InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException,
            TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
                DeleteFlowResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("DeleteFlow").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(deleteFlowRequest)
                .withMarshaller(new DeleteFlowRequestMarshaller(protocolFactory)));
    }

    /**
     * Displays the details of a flow. The response includes the flow ARN, name, and Availability Zone, as well as
     * details about the source, outputs, and entitlements.
     *
     * @param describeFlowRequest
     * @return Result of the DescribeFlow operation returned by the service.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws NotFoundException
     *         AWS Elemental MediaConnect did not find the resource that you specified in the request.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.DescribeFlow
     * @see AWS API
     *      Documentation
     */
    @Override
    public DescribeFlowResponse describeFlow(DescribeFlowRequest describeFlowRequest) throws BadRequestException,
            InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException,
            TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
                DescribeFlowResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("DescribeFlow").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(describeFlowRequest)
                .withMarshaller(new DescribeFlowRequestMarshaller(protocolFactory)));
    }

    /**
     * Grants entitlements to an existing flow.
     *
     * @param grantFlowEntitlementsRequest
     *        A request to grant entitlements on a flow.
     * @return Result of the GrantFlowEntitlements operation returned by the service.
     * @throws GrantFlowEntitlements420Exception
     *         AWS Elemental MediaConnect can't complete this request because this flow already has the maximum number
     *         of allowed entitlements (50). For more information, contact AWS Customer Support.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @throws ForbiddenException
     *         You don't have the required permissions to perform this operation.
     * @throws NotFoundException
     *         AWS Elemental MediaConnect did not find the resource that you specified in the request.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.GrantFlowEntitlements
     * @see AWS API Documentation
     */
    @Override
    public GrantFlowEntitlementsResponse grantFlowEntitlements(GrantFlowEntitlementsRequest grantFlowEntitlementsRequest)
            throws GrantFlowEntitlements420Exception, BadRequestException, InternalServerErrorException, ForbiddenException,
            NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException,
            MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
                operationMetadata, GrantFlowEntitlementsResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("GrantFlowEntitlements").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(grantFlowEntitlementsRequest)
                .withMarshaller(new GrantFlowEntitlementsRequestMarshaller(protocolFactory)));
    }

    /**
     * Displays a list of all entitlements that have been granted to this account. This request returns 20 results per
     * page.
     *
     * @param listEntitlementsRequest
     * @return Result of the ListEntitlements operation returned by the service.
     * @throws ServiceUnavailableException
     *         AWS Elemental MediaConnect is currently unavailable. Try again later.
     * @throws TooManyRequestsException
     *         You have exceeded the service request rate limit for your AWS Elemental MediaConnect account.
     * @throws BadRequestException
     *         The request that you submitted is not valid.
     * @throws InternalServerErrorException
     *         AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition.
     * @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 MediaConnectException
     *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
     * @sample MediaConnectClient.ListEntitlements
     * @see AWS
     *      API Documentation
     */
    @Override
    public ListEntitlementsResponse listEntitlements(ListEntitlementsRequest listEntitlementsRequest)
            throws ServiceUnavailableException, TooManyRequestsException, BadRequestException, InternalServerErrorException,
            AwsServiceException, SdkClientException, MediaConnectException {
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
                .isPayloadJson(true).build();

        HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
                ListEntitlementsResponse::builder);

        HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
                operationMetadata);

        return clientHandler.execute(new ClientExecutionParams()
                .withOperationName("ListEntitlements").withResponseHandler(responseHandler)
                .withErrorResponseHandler(errorResponseHandler).withInput(listEntitlementsRequest)
                .withMarshaller(new ListEntitlementsRequestMarshaller(protocolFactory)));
    }

    /**
     * Displays a list of all entitlements that have been granted to this account. This request returns 20 results per
     * page.
*

* This is a variant of * {@link #listEntitlements(software.amazon.awssdk.services.mediaconnect.model.ListEntitlementsRequest)} operation. * The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally * handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.mediaconnect.paginators.ListEntitlementsIterable responses = client.listEntitlementsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.mediaconnect.paginators.ListEntitlementsIterable responses = client
     *             .listEntitlementsPaginator(request);
     *     for (software.amazon.awssdk.services.mediaconnect.model.ListEntitlementsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.mediaconnect.paginators.ListEntitlementsIterable responses = client.listEntitlementsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

* Note: If you prefer to have control on service calls, use the * {@link #listEntitlements(software.amazon.awssdk.services.mediaconnect.model.ListEntitlementsRequest)} * operation. *

* * @param listEntitlementsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect account. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.ListEntitlements * @see AWS * API Documentation */ @Override public ListEntitlementsIterable listEntitlementsPaginator(ListEntitlementsRequest listEntitlementsRequest) throws ServiceUnavailableException, TooManyRequestsException, BadRequestException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaConnectException { return new ListEntitlementsIterable(this, applyPaginatorUserAgent(listEntitlementsRequest)); } /** * Displays a list of flows that are associated with this account. This request returns a paginated result. * * @param listFlowsRequest * @return Result of the ListFlows operation returned by the service. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect account. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.ListFlows * @see AWS API * Documentation */ @Override public ListFlowsResponse listFlows(ListFlowsRequest listFlowsRequest) throws ServiceUnavailableException, TooManyRequestsException, BadRequestException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListFlowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListFlows").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listFlowsRequest) .withMarshaller(new ListFlowsRequestMarshaller(protocolFactory))); } /** * Displays a list of flows that are associated with this account. This request returns a paginated result.
*

* This is a variant of {@link #listFlows(software.amazon.awssdk.services.mediaconnect.model.ListFlowsRequest)} * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will * internally handle making service calls for you. *

*

* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your * request, you will see the failures only after you start iterating through the iterable. *

* *

* The following are few ways to iterate through the response pages: *

* 1) Using a Stream * *
     * {@code
     * software.amazon.awssdk.services.mediaconnect.paginators.ListFlowsIterable responses = client.listFlowsPaginator(request);
     * responses.stream().forEach(....);
     * }
     * 
* * 2) Using For loop * *
     * {
     *     @code
     *     software.amazon.awssdk.services.mediaconnect.paginators.ListFlowsIterable responses = client.listFlowsPaginator(request);
     *     for (software.amazon.awssdk.services.mediaconnect.model.ListFlowsResponse response : responses) {
     *         // do something;
     *     }
     * }
     * 
* * 3) Use iterator directly * *
     * {@code
     * software.amazon.awssdk.services.mediaconnect.paginators.ListFlowsIterable responses = client.listFlowsPaginator(request);
     * responses.iterator().forEachRemaining(....);
     * }
     * 
*

* Note: If you prefer to have control on service calls, use the * {@link #listFlows(software.amazon.awssdk.services.mediaconnect.model.ListFlowsRequest)} operation. *

* * @param listFlowsRequest * @return A custom iterable that can be used to iterate through all the response pages. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect account. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.ListFlows * @see AWS API * Documentation */ @Override public ListFlowsIterable listFlowsPaginator(ListFlowsRequest listFlowsRequest) throws ServiceUnavailableException, TooManyRequestsException, BadRequestException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaConnectException { return new ListFlowsIterable(this, applyPaginatorUserAgent(listFlowsRequest)); } /** * List all tags on an AWS Elemental MediaConnect resource * * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws NotFoundException * The requested resource was not found * @throws BadRequestException * The client performed an invalid request * @throws InternalServerErrorException * Internal service error * @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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws NotFoundException, BadRequestException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTagsForResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("ListTagsForResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest) .withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))); } /** * Removes an output from an existing flow. This request can be made only on an output that does not have an * entitlement associated with it. If the output has an entitlement, you must revoke the entitlement instead. When * an entitlement is revoked from a flow, the service automatically removes the associated output. * * @param removeFlowOutputRequest * @return Result of the RemoveFlowOutput operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.RemoveFlowOutput * @see AWS * API Documentation */ @Override public RemoveFlowOutputResponse removeFlowOutput(RemoveFlowOutputRequest removeFlowOutputRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, RemoveFlowOutputResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RemoveFlowOutput").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(removeFlowOutputRequest) .withMarshaller(new RemoveFlowOutputRequestMarshaller(protocolFactory))); } /** * Removes a source from an existing flow. This request can be made only if there is more than one source on the * flow. * * @param removeFlowSourceRequest * @return Result of the RemoveFlowSource operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.RemoveFlowSource * @see AWS * API Documentation */ @Override public RemoveFlowSourceResponse removeFlowSource(RemoveFlowSourceRequest removeFlowSourceRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, RemoveFlowSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RemoveFlowSource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(removeFlowSourceRequest) .withMarshaller(new RemoveFlowSourceRequestMarshaller(protocolFactory))); } /** * Removes a VPC Interface from an existing flow. This request can be made only on a VPC interface that does not * have a Source or Output associated with it. If the VPC interface is referenced by a Source or Output, you must * first delete or update the Source or Output to no longer reference the VPC interface. * * @param removeFlowVpcInterfaceRequest * @return Result of the RemoveFlowVpcInterface operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.RemoveFlowVpcInterface * @see AWS API Documentation */ @Override public RemoveFlowVpcInterfaceResponse removeFlowVpcInterface(RemoveFlowVpcInterfaceRequest removeFlowVpcInterfaceRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveFlowVpcInterfaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RemoveFlowVpcInterface").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(removeFlowVpcInterfaceRequest) .withMarshaller(new RemoveFlowVpcInterfaceRequestMarshaller(protocolFactory))); } /** * Revokes an entitlement from a flow. Once an entitlement is revoked, the content becomes unavailable to the * subscriber and the associated output is removed. * * @param revokeFlowEntitlementRequest * @return Result of the RevokeFlowEntitlement operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.RevokeFlowEntitlement * @see AWS API Documentation */ @Override public RevokeFlowEntitlementResponse revokeFlowEntitlement(RevokeFlowEntitlementRequest revokeFlowEntitlementRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RevokeFlowEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("RevokeFlowEntitlement").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(revokeFlowEntitlementRequest) .withMarshaller(new RevokeFlowEntitlementRequestMarshaller(protocolFactory))); } /** * Starts a flow. * * @param startFlowRequest * @return Result of the StartFlow operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.StartFlow * @see AWS API * Documentation */ @Override public StartFlowResponse startFlow(StartFlowRequest startFlowRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartFlowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("StartFlow").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(startFlowRequest) .withMarshaller(new StartFlowRequestMarshaller(protocolFactory))); } /** * Stops a flow. * * @param stopFlowRequest * @return Result of the StopFlow operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.StopFlow * @see AWS API * Documentation */ @Override public StopFlowResponse stopFlow(StopFlowRequest stopFlowRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopFlowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams().withOperationName("StopFlow") .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withInput(stopFlowRequest) .withMarshaller(new StopFlowRequestMarshaller(protocolFactory))); } /** * Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource are * not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated * with that resource are deleted as well. * * @param tagResourceRequest * The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum * character length of 128 characters, and tag values can have a maximum length of 256 characters. * @return Result of the TagResource operation returned by the service. * @throws NotFoundException * The requested resource was not found * @throws BadRequestException * The client performed an invalid request * @throws InternalServerErrorException * Internal service error * @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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.TagResource * @see AWS API * Documentation */ @Override public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws NotFoundException, BadRequestException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("TagResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory))); } /** * Deletes specified tags from a resource. * * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws NotFoundException * The requested resource was not found * @throws BadRequestException * The client performed an invalid request * @throws InternalServerErrorException * Internal service error * @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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.UntagResource * @see AWS API * Documentation */ @Override public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws NotFoundException, BadRequestException, InternalServerErrorException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UntagResource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory))); } /** * Updates flow * * @param updateFlowRequest * A request to update flow. * @return Result of the UpdateFlow operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.UpdateFlow * @see AWS API * Documentation */ @Override public UpdateFlowResponse updateFlow(UpdateFlowRequest updateFlowRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateFlowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateFlow").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateFlowRequest) .withMarshaller(new UpdateFlowRequestMarshaller(protocolFactory))); } /** * You can change an entitlement's description, subscribers, and encryption. If you change the subscribers, the * service will remove the outputs that are are used by the subscribers that are removed. * * @param updateFlowEntitlementRequest * The entitlement fields that you want to update. * @return Result of the UpdateFlowEntitlement operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.UpdateFlowEntitlement * @see AWS API Documentation */ @Override public UpdateFlowEntitlementResponse updateFlowEntitlement(UpdateFlowEntitlementRequest updateFlowEntitlementRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateFlowEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateFlowEntitlement").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateFlowEntitlementRequest) .withMarshaller(new UpdateFlowEntitlementRequestMarshaller(protocolFactory))); } /** * Updates an existing flow output. * * @param updateFlowOutputRequest * The fields that you want to update in the output. * @return Result of the UpdateFlowOutput operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.UpdateFlowOutput * @see AWS * API Documentation */ @Override public UpdateFlowOutputResponse updateFlowOutput(UpdateFlowOutputRequest updateFlowOutputRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateFlowOutputResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateFlowOutput").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateFlowOutputRequest) .withMarshaller(new UpdateFlowOutputRequestMarshaller(protocolFactory))); } /** * Updates the source of a flow. * * @param updateFlowSourceRequest * A request to update the source of a flow. * @return Result of the UpdateFlowSource operation returned by the service. * @throws BadRequestException * The request that you submitted is not valid. * @throws InternalServerErrorException * AWS Elemental MediaConnect can't fulfill your request because it encountered an unexpected condition. * @throws ForbiddenException * You don't have the required permissions to perform this operation. * @throws NotFoundException * AWS Elemental MediaConnect did not find the resource that you specified in the request. * @throws ServiceUnavailableException * AWS Elemental MediaConnect is currently unavailable. Try again later. * @throws TooManyRequestsException * You have exceeded the service request rate limit for your AWS Elemental MediaConnect 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 MediaConnectException * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. * @sample MediaConnectClient.UpdateFlowSource * @see AWS * API Documentation */ @Override public UpdateFlowSourceResponse updateFlowSource(UpdateFlowSourceRequest updateFlowSourceRequest) throws BadRequestException, InternalServerErrorException, ForbiddenException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, AwsServiceException, SdkClientException, MediaConnectException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateFlowSourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); return clientHandler.execute(new ClientExecutionParams() .withOperationName("UpdateFlowSource").withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(updateFlowSourceRequest) .withMarshaller(new UpdateFlowSourceRequestMarshaller(protocolFactory))); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(MediaConnectException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("CreateFlow420Exception") .exceptionBuilderSupplier(CreateFlow420Exception::builder).httpStatusCode(420).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("NotFoundException") .exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("GrantFlowEntitlements420Exception") .exceptionBuilderSupplier(GrantFlowEntitlements420Exception::builder).httpStatusCode(420).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ForbiddenException") .exceptionBuilderSupplier(ForbiddenException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AddFlowOutputs420Exception") .exceptionBuilderSupplier(AddFlowOutputs420Exception::builder).httpStatusCode(420).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyRequestsException") .exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("BadRequestException") .exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerErrorException") .exceptionBuilderSupplier(InternalServerErrorException::builder).httpStatusCode(500).build()); } @Override public void close() { clientHandler.close(); } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy