
software.amazon.awssdk.services.mediatailor.DefaultMediaTailorClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.mediatailor;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.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.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
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.mediatailor.model.BadRequestException;
import software.amazon.awssdk.services.mediatailor.model.ConfigureLogsForPlaybackConfigurationRequest;
import software.amazon.awssdk.services.mediatailor.model.ConfigureLogsForPlaybackConfigurationResponse;
import software.amazon.awssdk.services.mediatailor.model.CreateChannelRequest;
import software.amazon.awssdk.services.mediatailor.model.CreateChannelResponse;
import software.amazon.awssdk.services.mediatailor.model.CreatePrefetchScheduleRequest;
import software.amazon.awssdk.services.mediatailor.model.CreatePrefetchScheduleResponse;
import software.amazon.awssdk.services.mediatailor.model.CreateProgramRequest;
import software.amazon.awssdk.services.mediatailor.model.CreateProgramResponse;
import software.amazon.awssdk.services.mediatailor.model.CreateSourceLocationRequest;
import software.amazon.awssdk.services.mediatailor.model.CreateSourceLocationResponse;
import software.amazon.awssdk.services.mediatailor.model.CreateVodSourceRequest;
import software.amazon.awssdk.services.mediatailor.model.CreateVodSourceResponse;
import software.amazon.awssdk.services.mediatailor.model.DeleteChannelPolicyRequest;
import software.amazon.awssdk.services.mediatailor.model.DeleteChannelPolicyResponse;
import software.amazon.awssdk.services.mediatailor.model.DeleteChannelRequest;
import software.amazon.awssdk.services.mediatailor.model.DeleteChannelResponse;
import software.amazon.awssdk.services.mediatailor.model.DeletePlaybackConfigurationRequest;
import software.amazon.awssdk.services.mediatailor.model.DeletePlaybackConfigurationResponse;
import software.amazon.awssdk.services.mediatailor.model.DeletePrefetchScheduleRequest;
import software.amazon.awssdk.services.mediatailor.model.DeletePrefetchScheduleResponse;
import software.amazon.awssdk.services.mediatailor.model.DeleteProgramRequest;
import software.amazon.awssdk.services.mediatailor.model.DeleteProgramResponse;
import software.amazon.awssdk.services.mediatailor.model.DeleteSourceLocationRequest;
import software.amazon.awssdk.services.mediatailor.model.DeleteSourceLocationResponse;
import software.amazon.awssdk.services.mediatailor.model.DeleteVodSourceRequest;
import software.amazon.awssdk.services.mediatailor.model.DeleteVodSourceResponse;
import software.amazon.awssdk.services.mediatailor.model.DescribeChannelRequest;
import software.amazon.awssdk.services.mediatailor.model.DescribeChannelResponse;
import software.amazon.awssdk.services.mediatailor.model.DescribeProgramRequest;
import software.amazon.awssdk.services.mediatailor.model.DescribeProgramResponse;
import software.amazon.awssdk.services.mediatailor.model.DescribeSourceLocationRequest;
import software.amazon.awssdk.services.mediatailor.model.DescribeSourceLocationResponse;
import software.amazon.awssdk.services.mediatailor.model.DescribeVodSourceRequest;
import software.amazon.awssdk.services.mediatailor.model.DescribeVodSourceResponse;
import software.amazon.awssdk.services.mediatailor.model.GetChannelPolicyRequest;
import software.amazon.awssdk.services.mediatailor.model.GetChannelPolicyResponse;
import software.amazon.awssdk.services.mediatailor.model.GetChannelScheduleRequest;
import software.amazon.awssdk.services.mediatailor.model.GetChannelScheduleResponse;
import software.amazon.awssdk.services.mediatailor.model.GetPlaybackConfigurationRequest;
import software.amazon.awssdk.services.mediatailor.model.GetPlaybackConfigurationResponse;
import software.amazon.awssdk.services.mediatailor.model.GetPrefetchScheduleRequest;
import software.amazon.awssdk.services.mediatailor.model.GetPrefetchScheduleResponse;
import software.amazon.awssdk.services.mediatailor.model.ListAlertsRequest;
import software.amazon.awssdk.services.mediatailor.model.ListAlertsResponse;
import software.amazon.awssdk.services.mediatailor.model.ListChannelsRequest;
import software.amazon.awssdk.services.mediatailor.model.ListChannelsResponse;
import software.amazon.awssdk.services.mediatailor.model.ListPlaybackConfigurationsRequest;
import software.amazon.awssdk.services.mediatailor.model.ListPlaybackConfigurationsResponse;
import software.amazon.awssdk.services.mediatailor.model.ListPrefetchSchedulesRequest;
import software.amazon.awssdk.services.mediatailor.model.ListPrefetchSchedulesResponse;
import software.amazon.awssdk.services.mediatailor.model.ListSourceLocationsRequest;
import software.amazon.awssdk.services.mediatailor.model.ListSourceLocationsResponse;
import software.amazon.awssdk.services.mediatailor.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.mediatailor.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.mediatailor.model.ListVodSourcesRequest;
import software.amazon.awssdk.services.mediatailor.model.ListVodSourcesResponse;
import software.amazon.awssdk.services.mediatailor.model.MediaTailorException;
import software.amazon.awssdk.services.mediatailor.model.MediaTailorRequest;
import software.amazon.awssdk.services.mediatailor.model.PutChannelPolicyRequest;
import software.amazon.awssdk.services.mediatailor.model.PutChannelPolicyResponse;
import software.amazon.awssdk.services.mediatailor.model.PutPlaybackConfigurationRequest;
import software.amazon.awssdk.services.mediatailor.model.PutPlaybackConfigurationResponse;
import software.amazon.awssdk.services.mediatailor.model.StartChannelRequest;
import software.amazon.awssdk.services.mediatailor.model.StartChannelResponse;
import software.amazon.awssdk.services.mediatailor.model.StopChannelRequest;
import software.amazon.awssdk.services.mediatailor.model.StopChannelResponse;
import software.amazon.awssdk.services.mediatailor.model.TagResourceRequest;
import software.amazon.awssdk.services.mediatailor.model.TagResourceResponse;
import software.amazon.awssdk.services.mediatailor.model.UntagResourceRequest;
import software.amazon.awssdk.services.mediatailor.model.UntagResourceResponse;
import software.amazon.awssdk.services.mediatailor.model.UpdateChannelRequest;
import software.amazon.awssdk.services.mediatailor.model.UpdateChannelResponse;
import software.amazon.awssdk.services.mediatailor.model.UpdateSourceLocationRequest;
import software.amazon.awssdk.services.mediatailor.model.UpdateSourceLocationResponse;
import software.amazon.awssdk.services.mediatailor.model.UpdateVodSourceRequest;
import software.amazon.awssdk.services.mediatailor.model.UpdateVodSourceResponse;
import software.amazon.awssdk.services.mediatailor.paginators.GetChannelScheduleIterable;
import software.amazon.awssdk.services.mediatailor.paginators.ListAlertsIterable;
import software.amazon.awssdk.services.mediatailor.paginators.ListChannelsIterable;
import software.amazon.awssdk.services.mediatailor.paginators.ListPlaybackConfigurationsIterable;
import software.amazon.awssdk.services.mediatailor.paginators.ListPrefetchSchedulesIterable;
import software.amazon.awssdk.services.mediatailor.paginators.ListSourceLocationsIterable;
import software.amazon.awssdk.services.mediatailor.paginators.ListVodSourcesIterable;
import software.amazon.awssdk.services.mediatailor.transform.ConfigureLogsForPlaybackConfigurationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.CreateChannelRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.CreatePrefetchScheduleRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.CreateProgramRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.CreateSourceLocationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.CreateVodSourceRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeleteChannelPolicyRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeleteChannelRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeletePlaybackConfigurationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeletePrefetchScheduleRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeleteProgramRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeleteSourceLocationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DeleteVodSourceRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DescribeChannelRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DescribeProgramRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DescribeSourceLocationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.DescribeVodSourceRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.GetChannelPolicyRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.GetChannelScheduleRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.GetPlaybackConfigurationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.GetPrefetchScheduleRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListAlertsRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListChannelsRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListPlaybackConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListPrefetchSchedulesRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListSourceLocationsRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.ListVodSourcesRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.PutChannelPolicyRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.PutPlaybackConfigurationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.StartChannelRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.StopChannelRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.UpdateChannelRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.UpdateSourceLocationRequestMarshaller;
import software.amazon.awssdk.services.mediatailor.transform.UpdateVodSourceRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link MediaTailorClient}.
*
* @see MediaTailorClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultMediaTailorClient implements MediaTailorClient {
private static final Logger log = Logger.loggerFor(DefaultMediaTailorClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultMediaTailorClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Configures Amazon CloudWatch log settings for a playback configuration.
*
*
* @param configureLogsForPlaybackConfigurationRequest
* Configures Amazon CloudWatch log settings for a playback configuration.
* @return Result of the ConfigureLogsForPlaybackConfiguration 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ConfigureLogsForPlaybackConfiguration
* @see AWS API Documentation
*/
@Override
public ConfigureLogsForPlaybackConfigurationResponse configureLogsForPlaybackConfiguration(
ConfigureLogsForPlaybackConfigurationRequest configureLogsForPlaybackConfigurationRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ConfigureLogsForPlaybackConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
configureLogsForPlaybackConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConfigureLogsForPlaybackConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ConfigureLogsForPlaybackConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler)
.withInput(configureLogsForPlaybackConfigurationRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ConfigureLogsForPlaybackConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a channel.
*
*
* @param createChannelRequest
* @return Result of the CreateChannel 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.CreateChannel
* @see AWS API
* Documentation
*/
@Override
public CreateChannelResponse createChannel(CreateChannelRequest createChannelRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateChannel");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a new prefetch schedule for the specified playback configuration.
*
*
* @param createPrefetchScheduleRequest
* @return Result of the CreatePrefetchSchedule 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.CreatePrefetchSchedule
* @see AWS API Documentation
*/
@Override
public CreatePrefetchScheduleResponse createPrefetchSchedule(CreatePrefetchScheduleRequest createPrefetchScheduleRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreatePrefetchScheduleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createPrefetchScheduleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePrefetchSchedule");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreatePrefetchSchedule").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createPrefetchScheduleRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreatePrefetchScheduleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a program.
*
*
* @param createProgramRequest
* @return Result of the CreateProgram 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.CreateProgram
* @see AWS API
* Documentation
*/
@Override
public CreateProgramResponse createProgram(CreateProgramRequest createProgramRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateProgramResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createProgramRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateProgram");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateProgram").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createProgramRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateProgramRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a source location on a specific channel.
*
*
* @param createSourceLocationRequest
* @return Result of the CreateSourceLocation 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.CreateSourceLocation
* @see AWS API Documentation
*/
@Override
public CreateSourceLocationResponse createSourceLocation(CreateSourceLocationRequest createSourceLocationRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateSourceLocationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSourceLocationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSourceLocation");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateSourceLocation").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createSourceLocationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSourceLocationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates name for a specific VOD source in a source location.
*
*
* @param createVodSourceRequest
* @return Result of the CreateVodSource 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.CreateVodSource
* @see AWS
* API Documentation
*/
@Override
public CreateVodSourceResponse createVodSource(CreateVodSourceRequest createVodSourceRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateVodSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createVodSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVodSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateVodSource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createVodSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateVodSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a channel. You must stop the channel before it can be deleted.
*
*
* @param deleteChannelRequest
* @return Result of the DeleteChannel 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeleteChannel
* @see AWS API
* Documentation
*/
@Override
public DeleteChannelResponse deleteChannel(DeleteChannelRequest deleteChannelRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteChannel");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a channel's IAM policy.
*
*
* @param deleteChannelPolicyRequest
* @return Result of the DeleteChannelPolicy 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeleteChannelPolicy
* @see AWS API Documentation
*/
@Override
public DeleteChannelPolicyResponse deleteChannelPolicy(DeleteChannelPolicyRequest deleteChannelPolicyRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteChannelPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteChannelPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteChannelPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteChannelPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteChannelPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteChannelPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the playback configuration for the specified name.
*
*
* @param deletePlaybackConfigurationRequest
* @return Result of the DeletePlaybackConfiguration 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeletePlaybackConfiguration
* @see AWS API Documentation
*/
@Override
public DeletePlaybackConfigurationResponse deletePlaybackConfiguration(
DeletePlaybackConfigurationRequest deletePlaybackConfigurationRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeletePlaybackConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePlaybackConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePlaybackConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeletePlaybackConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deletePlaybackConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeletePlaybackConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a prefetch schedule for a specific playback configuration. If you call DeletePrefetchSchedule on an
* expired prefetch schedule, MediaTailor returns an HTTP 404 status code.
*
*
* @param deletePrefetchScheduleRequest
* @return Result of the DeletePrefetchSchedule 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeletePrefetchSchedule
* @see AWS API Documentation
*/
@Override
public DeletePrefetchScheduleResponse deletePrefetchSchedule(DeletePrefetchScheduleRequest deletePrefetchScheduleRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeletePrefetchScheduleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePrefetchScheduleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePrefetchSchedule");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeletePrefetchSchedule").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deletePrefetchScheduleRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeletePrefetchScheduleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a specific program on a specific channel.
*
*
* @param deleteProgramRequest
* @return Result of the DeleteProgram 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeleteProgram
* @see AWS API
* Documentation
*/
@Override
public DeleteProgramResponse deleteProgram(DeleteProgramRequest deleteProgramRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteProgramResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteProgramRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProgram");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteProgram").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteProgramRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteProgramRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a source location on a specific channel.
*
*
* @param deleteSourceLocationRequest
* @return Result of the DeleteSourceLocation 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeleteSourceLocation
* @see AWS API Documentation
*/
@Override
public DeleteSourceLocationResponse deleteSourceLocation(DeleteSourceLocationRequest deleteSourceLocationRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteSourceLocationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSourceLocationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSourceLocation");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteSourceLocation").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteSourceLocationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteSourceLocationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a specific VOD source in a specific source location.
*
*
* @param deleteVodSourceRequest
* @return Result of the DeleteVodSource 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DeleteVodSource
* @see AWS
* API Documentation
*/
@Override
public DeleteVodSourceResponse deleteVodSource(DeleteVodSourceRequest deleteVodSourceRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteVodSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVodSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVodSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteVodSource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteVodSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteVodSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the properties of a specific channel.
*
*
* @param describeChannelRequest
* @return Result of the DescribeChannel 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DescribeChannel
* @see AWS
* API Documentation
*/
@Override
public DescribeChannelResponse describeChannel(DescribeChannelRequest describeChannelRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeChannel");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the properties of the requested program.
*
*
* @param describeProgramRequest
* @return Result of the DescribeProgram 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DescribeProgram
* @see AWS
* API Documentation
*/
@Override
public DescribeProgramResponse describeProgram(DescribeProgramRequest describeProgramRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeProgramResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProgramRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProgram");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeProgram").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeProgramRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeProgramRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the properties of the requested source location.
*
*
* @param describeSourceLocationRequest
* @return Result of the DescribeSourceLocation 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DescribeSourceLocation
* @see AWS API Documentation
*/
@Override
public DescribeSourceLocationResponse describeSourceLocation(DescribeSourceLocationRequest describeSourceLocationRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeSourceLocationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSourceLocationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSourceLocation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeSourceLocation").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeSourceLocationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeSourceLocationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provides details about a specific VOD source in a specific source location.
*
*
* @param describeVodSourceRequest
* @return Result of the DescribeVodSource 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.DescribeVodSource
* @see AWS
* API Documentation
*/
@Override
public DescribeVodSourceResponse describeVodSource(DescribeVodSourceRequest describeVodSourceRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeVodSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeVodSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeVodSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeVodSource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeVodSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeVodSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about a channel's IAM policy.
*
*
* @param getChannelPolicyRequest
* @return Result of the GetChannelPolicy 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.GetChannelPolicy
* @see AWS
* API Documentation
*/
@Override
public GetChannelPolicyResponse getChannelPolicy(GetChannelPolicyRequest getChannelPolicyRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetChannelPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getChannelPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetChannelPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetChannelPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getChannelPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetChannelPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about your channel's schedule.
*
*
* @param getChannelScheduleRequest
* @return Result of the GetChannelSchedule 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.GetChannelSchedule
* @see AWS API Documentation
*/
@Override
public GetChannelScheduleResponse getChannelSchedule(GetChannelScheduleRequest getChannelScheduleRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetChannelScheduleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getChannelScheduleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetChannelSchedule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetChannelSchedule").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getChannelScheduleRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetChannelScheduleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about your channel's schedule.
*
*
*
* This is a variant of
* {@link #getChannelSchedule(software.amazon.awssdk.services.mediatailor.model.GetChannelScheduleRequest)}
* 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.mediatailor.paginators.GetChannelScheduleIterable responses = client.getChannelSchedulePaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.GetChannelScheduleIterable responses = client
* .getChannelSchedulePaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.GetChannelScheduleResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.GetChannelScheduleIterable responses = client.getChannelSchedulePaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #getChannelSchedule(software.amazon.awssdk.services.mediatailor.model.GetChannelScheduleRequest)}
* operation.
*
*
* @param getChannelScheduleRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.GetChannelSchedule
* @see AWS API Documentation
*/
@Override
public GetChannelScheduleIterable getChannelSchedulePaginator(GetChannelScheduleRequest getChannelScheduleRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
return new GetChannelScheduleIterable(this, applyPaginatorUserAgent(getChannelScheduleRequest));
}
/**
*
* Returns the playback configuration for the specified name.
*
*
* @param getPlaybackConfigurationRequest
* @return Result of the GetPlaybackConfiguration 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.GetPlaybackConfiguration
* @see AWS API Documentation
*/
@Override
public GetPlaybackConfigurationResponse getPlaybackConfiguration(
GetPlaybackConfigurationRequest getPlaybackConfigurationRequest) throws AwsServiceException, SdkClientException,
MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetPlaybackConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getPlaybackConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPlaybackConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetPlaybackConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getPlaybackConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetPlaybackConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about the prefetch schedule for a specific playback configuration. If you call
* GetPrefetchSchedule on an expired prefetch schedule, MediaTailor returns an HTTP 404 status code.
*
*
* @param getPrefetchScheduleRequest
* @return Result of the GetPrefetchSchedule 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.GetPrefetchSchedule
* @see AWS API Documentation
*/
@Override
public GetPrefetchScheduleResponse getPrefetchSchedule(GetPrefetchScheduleRequest getPrefetchScheduleRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetPrefetchScheduleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getPrefetchScheduleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPrefetchSchedule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetPrefetchSchedule").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getPrefetchScheduleRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetPrefetchScheduleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of alerts for the given resource.
*
*
* @param listAlertsRequest
* @return Result of the ListAlerts 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListAlerts
* @see AWS API
* Documentation
*/
@Override
public ListAlertsResponse listAlerts(ListAlertsRequest listAlertsRequest) throws AwsServiceException, SdkClientException,
MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListAlertsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAlertsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAlerts");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("ListAlerts")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(listAlertsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAlertsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of alerts for the given resource.
*
*
*
* This is a variant of {@link #listAlerts(software.amazon.awssdk.services.mediatailor.model.ListAlertsRequest)}
* 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.mediatailor.paginators.ListAlertsIterable responses = client.listAlertsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.ListAlertsIterable responses = client.listAlertsPaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.ListAlertsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.ListAlertsIterable responses = client.listAlertsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAlerts(software.amazon.awssdk.services.mediatailor.model.ListAlertsRequest)} operation.
*
*
* @param listAlertsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListAlerts
* @see AWS API
* Documentation
*/
@Override
public ListAlertsIterable listAlertsPaginator(ListAlertsRequest listAlertsRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
return new ListAlertsIterable(this, applyPaginatorUserAgent(listAlertsRequest));
}
/**
*
* Retrieves a list of channels that are associated with this account.
*
*
* @param listChannelsRequest
* @return Result of the ListChannels 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListChannels
* @see AWS API
* Documentation
*/
@Override
public ListChannelsResponse listChannels(ListChannelsRequest listChannelsRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListChannelsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listChannelsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListChannels");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListChannels").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listChannelsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListChannelsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of channels that are associated with this account.
*
*
*
* This is a variant of {@link #listChannels(software.amazon.awssdk.services.mediatailor.model.ListChannelsRequest)}
* 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.mediatailor.paginators.ListChannelsIterable responses = client.listChannelsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.ListChannelsIterable responses = client.listChannelsPaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.ListChannelsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.ListChannelsIterable responses = client.listChannelsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listChannels(software.amazon.awssdk.services.mediatailor.model.ListChannelsRequest)} operation.
*
*
* @param listChannelsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListChannels
* @see AWS API
* Documentation
*/
@Override
public ListChannelsIterable listChannelsPaginator(ListChannelsRequest listChannelsRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
return new ListChannelsIterable(this, applyPaginatorUserAgent(listChannelsRequest));
}
/**
*
* Returns a list of the playback configurations defined in AWS Elemental MediaTailor. You can specify a maximum
* number of configurations to return at a time. The default maximum is 50. Results are returned in pagefuls. If
* MediaTailor has more configurations than the specified maximum, it provides parameters in the response that you
* can use to retrieve the next pageful.
*
*
* @param listPlaybackConfigurationsRequest
* @return Result of the ListPlaybackConfigurations 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListPlaybackConfigurations
* @see AWS API Documentation
*/
@Override
public ListPlaybackConfigurationsResponse listPlaybackConfigurations(
ListPlaybackConfigurationsRequest listPlaybackConfigurationsRequest) throws AwsServiceException, SdkClientException,
MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListPlaybackConfigurationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listPlaybackConfigurationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPlaybackConfigurations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListPlaybackConfigurations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listPlaybackConfigurationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListPlaybackConfigurationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of the playback configurations defined in AWS Elemental MediaTailor. You can specify a maximum
* number of configurations to return at a time. The default maximum is 50. Results are returned in pagefuls. If
* MediaTailor has more configurations than the specified maximum, it provides parameters in the response that you
* can use to retrieve the next pageful.
*
*
*
* This is a variant of
* {@link #listPlaybackConfigurations(software.amazon.awssdk.services.mediatailor.model.ListPlaybackConfigurationsRequest)}
* 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.mediatailor.paginators.ListPlaybackConfigurationsIterable responses = client.listPlaybackConfigurationsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.ListPlaybackConfigurationsIterable responses = client
* .listPlaybackConfigurationsPaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.ListPlaybackConfigurationsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.ListPlaybackConfigurationsIterable responses = client.listPlaybackConfigurationsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listPlaybackConfigurations(software.amazon.awssdk.services.mediatailor.model.ListPlaybackConfigurationsRequest)}
* operation.
*
*
* @param listPlaybackConfigurationsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListPlaybackConfigurations
* @see AWS API Documentation
*/
@Override
public ListPlaybackConfigurationsIterable listPlaybackConfigurationsPaginator(
ListPlaybackConfigurationsRequest listPlaybackConfigurationsRequest) throws AwsServiceException, SdkClientException,
MediaTailorException {
return new ListPlaybackConfigurationsIterable(this, applyPaginatorUserAgent(listPlaybackConfigurationsRequest));
}
/**
*
* Creates a new prefetch schedule.
*
*
* @param listPrefetchSchedulesRequest
* @return Result of the ListPrefetchSchedules 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListPrefetchSchedules
* @see AWS API Documentation
*/
@Override
public ListPrefetchSchedulesResponse listPrefetchSchedules(ListPrefetchSchedulesRequest listPrefetchSchedulesRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListPrefetchSchedulesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listPrefetchSchedulesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPrefetchSchedules");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListPrefetchSchedules").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listPrefetchSchedulesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListPrefetchSchedulesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a new prefetch schedule.
*
*
*
* This is a variant of
* {@link #listPrefetchSchedules(software.amazon.awssdk.services.mediatailor.model.ListPrefetchSchedulesRequest)}
* 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.mediatailor.paginators.ListPrefetchSchedulesIterable responses = client.listPrefetchSchedulesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.ListPrefetchSchedulesIterable responses = client
* .listPrefetchSchedulesPaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.ListPrefetchSchedulesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.ListPrefetchSchedulesIterable responses = client.listPrefetchSchedulesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listPrefetchSchedules(software.amazon.awssdk.services.mediatailor.model.ListPrefetchSchedulesRequest)}
* operation.
*
*
* @param listPrefetchSchedulesRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListPrefetchSchedules
* @see AWS API Documentation
*/
@Override
public ListPrefetchSchedulesIterable listPrefetchSchedulesPaginator(ListPrefetchSchedulesRequest listPrefetchSchedulesRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
return new ListPrefetchSchedulesIterable(this, applyPaginatorUserAgent(listPrefetchSchedulesRequest));
}
/**
*
* Retrieves a list of source locations.
*
*
* @param listSourceLocationsRequest
* @return Result of the ListSourceLocations 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListSourceLocations
* @see AWS API Documentation
*/
@Override
public ListSourceLocationsResponse listSourceLocations(ListSourceLocationsRequest listSourceLocationsRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListSourceLocationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listSourceLocationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSourceLocations");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListSourceLocations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listSourceLocationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListSourceLocationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of source locations.
*
*
*
* This is a variant of
* {@link #listSourceLocations(software.amazon.awssdk.services.mediatailor.model.ListSourceLocationsRequest)}
* 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.mediatailor.paginators.ListSourceLocationsIterable responses = client.listSourceLocationsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.ListSourceLocationsIterable responses = client
* .listSourceLocationsPaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.ListSourceLocationsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.ListSourceLocationsIterable responses = client.listSourceLocationsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listSourceLocations(software.amazon.awssdk.services.mediatailor.model.ListSourceLocationsRequest)}
* operation.
*
*
* @param listSourceLocationsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListSourceLocations
* @see AWS API Documentation
*/
@Override
public ListSourceLocationsIterable listSourceLocationsPaginator(ListSourceLocationsRequest listSourceLocationsRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
return new ListSourceLocationsIterable(this, applyPaginatorUserAgent(listSourceLocationsRequest));
}
/**
*
* Returns a list of the tags assigned to the specified playback configuration resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws BadRequestException
* One or more parameters in this request aren't 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws BadRequestException, AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the VOD sources in a source location.
*
*
* @param listVodSourcesRequest
* @return Result of the ListVodSources 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListVodSources
* @see AWS
* API Documentation
*/
@Override
public ListVodSourcesResponse listVodSources(ListVodSourcesRequest listVodSourcesRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListVodSourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listVodSourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListVodSources");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListVodSources").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listVodSourcesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListVodSourcesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the VOD sources in a source location.
*
*
*
* This is a variant of
* {@link #listVodSources(software.amazon.awssdk.services.mediatailor.model.ListVodSourcesRequest)} 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.mediatailor.paginators.ListVodSourcesIterable responses = client.listVodSourcesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.mediatailor.paginators.ListVodSourcesIterable responses = client
* .listVodSourcesPaginator(request);
* for (software.amazon.awssdk.services.mediatailor.model.ListVodSourcesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.mediatailor.paginators.ListVodSourcesIterable responses = client.listVodSourcesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listVodSources(software.amazon.awssdk.services.mediatailor.model.ListVodSourcesRequest)} operation.
*
*
* @param listVodSourcesRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.ListVodSources
* @see AWS
* API Documentation
*/
@Override
public ListVodSourcesIterable listVodSourcesPaginator(ListVodSourcesRequest listVodSourcesRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
return new ListVodSourcesIterable(this, applyPaginatorUserAgent(listVodSourcesRequest));
}
/**
*
* Creates an IAM policy for the channel.
*
*
* @param putChannelPolicyRequest
* @return Result of the PutChannelPolicy 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.PutChannelPolicy
* @see AWS
* API Documentation
*/
@Override
public PutChannelPolicyResponse putChannelPolicy(PutChannelPolicyRequest putChannelPolicyRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutChannelPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putChannelPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutChannelPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutChannelPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putChannelPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutChannelPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a new playback configuration to AWS Elemental MediaTailor.
*
*
* @param putPlaybackConfigurationRequest
* @return Result of the PutPlaybackConfiguration 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.PutPlaybackConfiguration
* @see AWS API Documentation
*/
@Override
public PutPlaybackConfigurationResponse putPlaybackConfiguration(
PutPlaybackConfigurationRequest putPlaybackConfigurationRequest) throws AwsServiceException, SdkClientException,
MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutPlaybackConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putPlaybackConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutPlaybackConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutPlaybackConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putPlaybackConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutPlaybackConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Starts a specific channel.
*
*
* @param startChannelRequest
* @return Result of the StartChannel 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.StartChannel
* @see AWS API
* Documentation
*/
@Override
public StartChannelResponse startChannel(StartChannelRequest startChannelRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartChannel");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stops a specific channel.
*
*
* @param stopChannelRequest
* @return Result of the StopChannel 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.StopChannel
* @see AWS API
* Documentation
*/
@Override
public StopChannelResponse stopChannel(StopChannelRequest stopChannelRequest) throws AwsServiceException, SdkClientException,
MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, stopChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopChannel");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StopChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(stopChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StopChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds tags to the specified playback configuration resource. You can specify one or more tags to add.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws BadRequestException
* One or more parameters in this request aren't 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws BadRequestException,
AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes tags from the specified playback configuration resource. You can specify one or more tags to remove.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws BadRequestException
* One or more parameters in this request aren't 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws BadRequestException,
AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates an existing channel.
*
*
* @param updateChannelRequest
* @return Result of the UpdateChannel 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.UpdateChannel
* @see AWS API
* Documentation
*/
@Override
public UpdateChannelResponse updateChannel(UpdateChannelRequest updateChannelRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateChannel");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a source location on a specific channel.
*
*
* @param updateSourceLocationRequest
* @return Result of the UpdateSourceLocation 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.UpdateSourceLocation
* @see AWS API Documentation
*/
@Override
public UpdateSourceLocationResponse updateSourceLocation(UpdateSourceLocationRequest updateSourceLocationRequest)
throws AwsServiceException, SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateSourceLocationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSourceLocationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSourceLocation");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateSourceLocation").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateSourceLocationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateSourceLocationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a specific VOD source in a specific source location.
*
*
* @param updateVodSourceRequest
* @return Result of the UpdateVodSource 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 MediaTailorException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample MediaTailorClient.UpdateVodSource
* @see AWS
* API Documentation
*/
@Override
public UpdateVodSourceResponse updateVodSource(UpdateVodSourceRequest updateVodSourceRequest) throws AwsServiceException,
SdkClientException, MediaTailorException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateVodSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateVodSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "MediaTailor");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateVodSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateVodSource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateVodSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateVodSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
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 > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(MediaTailorException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("BadRequestException")
.exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).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();
}
}