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 ResourceNotFoundException. May throw LimitExceededException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.

Parameter tags : The tags you want to modify or add to the resource.

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.0',
    'X-Amz-Target':
        'com.amazonaws.codestar.connections.CodeStar_connections_20191201.TagResource'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      'Tags': tags,
    },
  );
}