listTagsForResource method

Future<ListTagsForResourceOutput> listTagsForResource({
  1. required String resourceArn,
  2. String? nextToken,
})

Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

May throw RepositoryDoesNotExistException. May throw InvalidRepositoryNameException. May throw ResourceArnRequiredException. May throw InvalidResourceArnException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource for which you want to get information about tags, if any.

Parameter nextToken : An enumeration token that, when provided in a request, returns the next batch of the results.

Implementation

Future<ListTagsForResourceOutput> listTagsForResource({
  required String resourceArn,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeCommit_20150413.ListTagsForResource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceArn': resourceArn,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListTagsForResourceOutput.fromJson(jsonResponse.body);
}