tagResource method

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

Adds metadata tags to a specified resource.

May throw NotFoundException.

Parameter arn : The ARN of the resource to which to add metadata tags. Required.

Parameter tags : The tags to be added to the specified resource. Do not provide system tags. Required.

Implementation

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