tagResource method

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

Tags an Amazon FSx resource.

May throw BadRequest. May throw InternalServerError. May throw ResourceNotFound. May throw NotServiceResourceError. May throw ResourceDoesNotSupportTagging.

Parameter resourceARN : The Amazon Resource Name (ARN) of the Amazon FSx resource that you want to tag.

Parameter tags : A list of tags for the resource. If a tag with a given key already exists, the value is replaced by the one specified in this parameter.

Implementation

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