tagResource method

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

Adds or overwrites one or more tags for the specified resource, such as a fleet. Each tag consists of a key and an optional value. If a resource already has a tag with the same key, this operation updates its value.

May throw InvalidRequestException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the fleet.

Parameter tags : The tags to add to the resource. A tag is a key-value pair.

Implementation

Future<void> tagResource({
  required String resourceArn,
  required Map<String, String> tags,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    20,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final $payload = <String, dynamic>{
    'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
    exceptionFnMap: _exceptionFns,
  );
}