deleteKeyGroup2020_05_31 method
Deletes a key group.
You cannot delete a key group that is referenced in a cache behavior. First update your distributions to remove the key group from all cache behaviors, then delete the key group.
To delete a key group, you must provide the key group’s identifier and
version. To get these values, use ListKeyGroups
followed by
GetKeyGroup
or GetKeyGroupConfig
.
May throw InvalidIfMatchVersion. May throw NoSuchResource. May throw PreconditionFailed. May throw ResourceInUse.
Parameter id
:
The identifier of the key group that you are deleting. To get the
identifier, use ListKeyGroups
.
Parameter ifMatch
:
The version of the key group that you are deleting. The version is the key
group’s ETag
value. To get the ETag
, use
GetKeyGroup
or GetKeyGroupConfig
.
Implementation
Future<void> deleteKeyGroup2020_05_31({
required String id,
String? ifMatch,
}) async {
ArgumentError.checkNotNull(id, 'id');
final headers = <String, String>{
if (ifMatch != null) 'If-Match': ifMatch.toString(),
};
await _protocol.send(
method: 'DELETE',
requestUri: '/2020-05-31/key-group/${Uri.encodeComponent(id)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}