updateCloudFrontOriginAccessIdentity method
Update an origin access identity.
May throw AccessDenied.
May throw IllegalUpdate.
May throw InconsistentQuantities.
May throw InvalidArgument.
May throw InvalidIfMatchVersion.
May throw MissingBody.
May throw NoSuchCloudFrontOriginAccessIdentity.
May throw PreconditionFailed.
Parameter cloudFrontOriginAccessIdentityConfig :
The identity's configuration information.
Parameter id :
The identity's id.
Parameter ifMatch :
The value of the ETag header that you received when
retrieving the identity's configuration. For example:
E2QWRUHAPOMQZL.
Implementation
Future<UpdateCloudFrontOriginAccessIdentityResult>
updateCloudFrontOriginAccessIdentity({
required CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig,
required String id,
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-identity/cloudfront/${Uri.encodeComponent(id)}/config',
headers: headers,
payload: cloudFrontOriginAccessIdentityConfig
.toXml('CloudFrontOriginAccessIdentityConfig'),
exceptionFnMap: _exceptionFns,
);
final $elem = await _s.xmlFromResponse($result);
return UpdateCloudFrontOriginAccessIdentityResult(
cloudFrontOriginAccessIdentity:
CloudFrontOriginAccessIdentity.fromXml($elem),
eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
);
}