tagResource method

Future<void> tagResource({
  1. required String resourceArn,
  2. required List<Tag> tagList,
})

Adds one or more tags to an AWS resource.

May throw ResourceNotFoundException. May throw InvalidOperationException. May throw InternalErrorException. May throw InvalidInputException. May throw LimitExceededException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource to return tags for. The AWS Firewall Manager resources that support tagging are policies, applications lists, and protocols lists.

Parameter tagList : The tags to add to the resource.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required List<Tag> tagList,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tagList, 'tagList');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSFMS_20180101.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      'TagList': tagList,
    },
  );
}