deleteOriginAccessControl method

Future<void> deleteOriginAccessControl({
  1. required String id,
  2. String? ifMatch,
})

Deletes a CloudFront origin access control.

You cannot delete an origin access control if it's in use. First, update all distributions to remove the origin access control from all origins, then delete the origin access control.

May throw AccessDenied. May throw InvalidIfMatchVersion. May throw NoSuchOriginAccessControl. May throw OriginAccessControlInUse. May throw PreconditionFailed.

Parameter id : The unique identifier of the origin access control that you are deleting.

Parameter ifMatch : The current version (ETag value) of the origin access control that you are deleting.

Implementation

Future<void> deleteOriginAccessControl({
  required String id,
  String? ifMatch,
}) async {
  final headers = <String, String>{
    if (ifMatch != null) 'If-Match': ifMatch.toString(),
  };
  await _protocol.send(
    method: 'DELETE',
    requestUri:
        '/2020-05-31/origin-access-control/${Uri.encodeComponent(id)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}