deleteResourcePolicy method

Future<void> deleteResourcePolicy({
  1. required String workspaceId,
  2. String? clientToken,
  3. String? revisionId,
})

Deletes the resource-based policy attached to an Amazon Managed Service for Prometheus workspace.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter workspaceId : The ID of the workspace from which to delete the resource-based policy.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the request is safe to retry (idempotent).

Parameter revisionId : The revision ID of the policy to delete. Use this parameter to ensure that you are deleting the correct version of the policy.

Implementation

Future<void> deleteResourcePolicy({
  required String workspaceId,
  String? clientToken,
  String? revisionId,
}) async {
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
    if (revisionId != null) 'revisionId': [revisionId],
  };
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/workspaces/${Uri.encodeComponent(workspaceId)}/policy',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}