listTags method

Future<ListTagsResponse> listTags({
  1. required String arn,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all tags for the specified resource.

May throw NotFoundException.

Parameter arn : The ARN of the specified resource for which to list tags.

Parameter maxResults : The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

Parameter nextToken : An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

Implementation

Future<ListTagsResponse> listTags({
  required String arn,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.ListTags'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Arn': arn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListTagsResponse.fromJson(jsonResponse.body);
}