tagResource method

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

Applies a key-value pair to an AWS resource.

May throw InvalidRequestException. May throw InternalException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource to apply the tag to.

Parameter tags : The tags to apply.

Implementation

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