putOriginEndpointPolicy method
Attaches an IAM policy to the specified origin endpoint. You can attach only one policy with each request.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter channelGroupName :
The name that describes the channel group. The name is the primary
identifier for the channel group, and must be unique for your account in
the AWS Region.
Parameter channelName :
The name that describes the channel. The name is the primary identifier
for the channel, and must be unique for your account in the AWS Region and
channel group.
Parameter originEndpointName :
The name that describes the origin endpoint. The name is the primary
identifier for the origin endpoint, and and must be unique for your
account in the AWS Region and channel.
Parameter policy :
The policy to attach to the specified origin endpoint.
Parameter cdnAuthConfiguration :
The settings for using authorization headers between the MediaPackage
endpoint and your CDN.
For information about CDN authorization, see CDN authorization in Elemental MediaPackage in the MediaPackage user guide.
Implementation
Future<void> putOriginEndpointPolicy({
required String channelGroupName,
required String channelName,
required String originEndpointName,
required String policy,
CdnAuthConfiguration? cdnAuthConfiguration,
}) async {
final $payload = <String, dynamic>{
'Policy': policy,
if (cdnAuthConfiguration != null)
'CdnAuthConfiguration': cdnAuthConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/channelGroup/${Uri.encodeComponent(channelGroupName)}/channel/${Uri.encodeComponent(channelName)}/originEndpoint/${Uri.encodeComponent(originEndpointName)}/policy',
exceptionFnMap: _exceptionFns,
);
}