updatePlaybackRestrictionPolicy method
Updates a specified playback restriction policy.
May throw AccessDeniedException.
May throw ConflictException.
May throw PendingVerification.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter arn :
ARN of the playback-restriction-policy to be updated.
Parameter allowedCountries :
A list of country codes that control geoblocking restriction. Allowed
values are the officially assigned ISO 3166-1
alpha-2 codes. Default: All countries (an empty array).
Parameter allowedOrigins :
A list of origin sites that control CORS restriction. Allowed values are
the same as valid values of the Origin header defined at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin.
Default: All origins (an empty array).
Parameter enableStrictOriginEnforcement :
Whether channel playback is constrained by origin site. Default:
false.
Parameter name :
Playback-restriction-policy name. The value does not need to be unique.
Implementation
Future<UpdatePlaybackRestrictionPolicyResponse>
updatePlaybackRestrictionPolicy({
required String arn,
List<String>? allowedCountries,
List<String>? allowedOrigins,
bool? enableStrictOriginEnforcement,
String? name,
}) async {
final $payload = <String, dynamic>{
'arn': arn,
if (allowedCountries != null) 'allowedCountries': allowedCountries,
if (allowedOrigins != null) 'allowedOrigins': allowedOrigins,
if (enableStrictOriginEnforcement != null)
'enableStrictOriginEnforcement': enableStrictOriginEnforcement,
if (name != null) 'name': name,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/UpdatePlaybackRestrictionPolicy',
exceptionFnMap: _exceptionFns,
);
return UpdatePlaybackRestrictionPolicyResponse.fromJson(response);
}