tagResource method

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

Adds one or more tags to the specified resource.

May throw ResourceNotFoundException. May throw TooManyTagsException. May throw InvalidInput.

Parameter resourceARN : The Amazon Resource Name (ARN) of the resource that you want to retrieve tags for.

Parameter tags : The tags to add to the specified resource. Specifying the tag key is required. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

Implementation

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