tagResource method

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

Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.

May throw LimitExceededException. May throw ResourceNotFoundException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.

Parameter tags : The tags you want to modify or add to the resource.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required List<Tag> tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'CodeConnections_20231201.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      'Tags': tags,
    },
  );
}