removePermission method

Future<void> removePermission({
  1. String? eventBusName,
  2. bool? removeAllPermissions,
  3. String? statementId,
})

Revokes the permission of another AWS account to be able to put events to the specified event bus. Specify the account to revoke by the StatementId value that you associated with the account when you granted it permission with PutPermission. You can find the StatementId by using DescribeEventBus.

May throw ResourceNotFoundException. May throw InternalException. May throw ConcurrentModificationException. May throw OperationDisabledException.

Parameter eventBusName : The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.

Parameter removeAllPermissions : Specifies whether to remove all permissions.

Parameter statementId : The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.

Implementation

Future<void> removePermission({
  String? eventBusName,
  bool? removeAllPermissions,
  String? statementId,
}) async {
  _s.validateStringLength(
    'eventBusName',
    eventBusName,
    1,
    256,
  );
  _s.validateStringLength(
    'statementId',
    statementId,
    1,
    64,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSEvents.RemovePermission'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (eventBusName != null) 'EventBusName': eventBusName,
      if (removeAllPermissions != null)
        'RemoveAllPermissions': removeAllPermissions,
      if (statementId != null) 'StatementId': statementId,
    },
  );
}