updateOriginAccessControl method
Updates a CloudFront origin access control.
May throw AccessDenied.
May throw IllegalUpdate.
May throw InvalidArgument.
May throw InvalidIfMatchVersion.
May throw NoSuchOriginAccessControl.
May throw OriginAccessControlAlreadyExists.
May throw PreconditionFailed.
Parameter id :
The unique identifier of the origin access control that you are updating.
Parameter originAccessControlConfig :
An origin access control.
Parameter ifMatch :
The current version (ETag value) of the origin access control
that you are updating.
Implementation
Future<UpdateOriginAccessControlResult> updateOriginAccessControl({
required String id,
required OriginAccessControlConfig originAccessControlConfig,
String? ifMatch,
}) async {
final headers = <String, String>{
if (ifMatch != null) 'If-Match': ifMatch.toString(),
};
final $result = await _protocol.sendRaw(
method: 'PUT',
requestUri:
'/2020-05-31/origin-access-control/${Uri.encodeComponent(id)}/config',
headers: headers,
payload: originAccessControlConfig.toXml('OriginAccessControlConfig'),
exceptionFnMap: _exceptionFns,
);
final $elem = await _s.xmlFromResponse($result);
return UpdateOriginAccessControlResult(
originAccessControl: OriginAccessControl.fromXml($elem),
eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
);
}