removeTags method

Future<void> removeTags({
  1. required String resourceId,
  2. List<Tag>? tagsList,
})

Removes the specified tags from a trail.

May throw ResourceNotFoundException. May throw CloudTrailARNInvalidException. May throw ResourceTypeNotSupportedException. May throw InvalidTrailNameException. May throw InvalidTagParameterException. May throw UnsupportedOperationException. May throw OperationNotPermittedException. May throw NotOrganizationMasterAccountException.

Parameter resourceId : Specifies the ARN of the trail from which tags should be removed. The format of a trail ARN is:

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

Parameter tagsList : Specifies a list of tags to be removed.

Implementation

Future<void> removeTags({
  required String resourceId,
  List<Tag>? tagsList,
}) async {
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.RemoveTags'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceId': resourceId,
      if (tagsList != null) 'TagsList': tagsList,
    },
  );
}