listTagsForResource method

Future<ListTagsForResourceResponse> listTagsForResource({
  1. required String resourceArn,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all tags on an AWS IoT Things Graph resource.

May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw ThrottlingException. May throw InternalFailureException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource whose tags are to be returned.

Parameter maxResults : The maximum number of tags to return.

Parameter nextToken : The token that specifies the next page of results to return.

Implementation

Future<ListTagsForResourceResponse> listTagsForResource({
  required String resourceArn,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    2048,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'IotThingsGraphFrontEndService.ListTagsForResource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceArn': resourceArn,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListTagsForResourceResponse.fromJson(jsonResponse.body);
}