tagResource method
Adds one or more tags to an associated repository.
May throw InternalServerException. May throw ValidationException. May throw ResourceNotFoundException.
Parameter tags
:
An array of key-value pairs used to tag an associated repository. A tag is
a custom attribute label with two parts:
-
A tag key (for example,
CostCenter
,Environment
,Project
, orSecret
). Tag keys are case sensitive. -
An optional field known as a tag value (for example,
111122223333
,Production
, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
Parameter resourceArn
:
The Amazon Resource Name (ARN) of the
RepositoryAssociation
object. You can retrieve this ARN
by calling
ListRepositoryAssociations
.
Implementation
Future<void> tagResource({
required Map<String, String> tags,
required String resourceArn,
}) async {
ArgumentError.checkNotNull(tags, 'tags');
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateStringLength(
'resourceArn',
resourceArn,
1,
1600,
isRequired: true,
);
final $payload = <String, dynamic>{
'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/tags/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}