tagResource method

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

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.

There is no response returned from this call.

May throw ServiceUnavailableException. May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException.

Parameter arn : An Amazon Resource Name (ARN) for a specific AWS resource, such as a server, user, or role.

Parameter tags : Key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to user accounts for any purpose.

Implementation

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