tagResource method

Future<void> tagResource({
  1. required String resourceArn,
  2. required Map<String, String> tags,
})

Adds or updates tags for a resource 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. May throw TagsMapRequiredException. May throw InvalidTagsMapException. May throw TooManyTagsException. May throw InvalidSystemTagUsageException. May throw TagPolicyException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.

Parameter tags : The key-value pair to use when tagging this repository.

Implementation

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