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 InvalidRequestException. May throw ResourceNotFoundException. May throw ResourceInUseException. May throw ThrottlingException. May throw LimitExceededException. May throw InternalFailureException.

Parameter resourceArn : The ARN of the resource.

Parameter tags : The new or modified tags for the resource.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final $query = <String, List<String>>{
    'resourceArn': [resourceArn],
  };
  final $payload = <String, dynamic>{
    'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/tags',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}