updateCloudFrontOriginAccessIdentity2018_06_18 method

Future<UpdateCloudFrontOriginAccessIdentityResult> updateCloudFrontOriginAccessIdentity2018_06_18(
  1. {@required CloudFrontOriginAccessIdentityConfig cloudFrontOriginAccessIdentityConfig,
  2. @required String id,
  3. String ifMatch}
)

Update an origin access identity.

May throw AccessDenied. May throw IllegalUpdate. May throw InvalidIfMatchVersion. May throw MissingBody. May throw NoSuchCloudFrontOriginAccessIdentity. May throw PreconditionFailed. May throw InvalidArgument. May throw InconsistentQuantities.

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>
    updateCloudFrontOriginAccessIdentity2018_06_18({
  @_s.required
      CloudFrontOriginAccessIdentityConfig
          cloudFrontOriginAccessIdentityConfig,
  @_s.required String id,
  String ifMatch,
}) async {
  ArgumentError.checkNotNull(cloudFrontOriginAccessIdentityConfig,
      'cloudFrontOriginAccessIdentityConfig');
  ArgumentError.checkNotNull(id, 'id');
  final headers = <String, String>{};
  ifMatch?.let((v) => headers['If-Match'] = v.toString());
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri:
        '/2018-06-18/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'),
  );
}