def tag_resource(
self,
resource_arn: "capo_codeguru_reviewer.types.association_arn.AssociationArn",
tags: "capo_codeguru_reviewer.types.tag_map.TagMap",
*,
config_overrides: Optional[CodeGuruReviewerClientConfig] = None,
) -> "capo_codeguru_reviewer.types.tag_resource_response.TagResourceResponse":
"""<p>Adds one or more tags to an associated repository.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a> object. You can retrieve this ARN by calling <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html">ListRepositoryAssociations</a>.</p>
tags: <p>An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:</p> <ul> <li> <p>A <i>tag key</i> (for example, <code>CostCenter</code>, <code>Environment</code>, <code>Project</code>, or <code>Secret</code>). Tag keys are case sensitive.</p> </li> <li> <p>An optional field known as a <i>tag value</i> (for example, <code>111122223333</code>, <code>Production</code>, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.</p> </li> </ul>
Raises:
capo_codeguru_reviewer.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
capo_codeguru_reviewer.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource specified in the request was not found. </p>
capo_codeguru_reviewer.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
capo_codeguru_reviewer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_codeguru_reviewer.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_codeguru_reviewer.types.tag_resource_response.TagResourceResponse"
]:
import capo_codeguru_reviewer._operations.aws_guru_frontend_service.tag_resource
output, http_response = (
capo_codeguru_reviewer._operations.aws_guru_frontend_service.tag_resource.tag_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagResource")
)
input_: capo_codeguru_reviewer.types.tag_resource_request.TagResourceRequest = {
"resource_arn": resource_arn,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output