Skip to content

tag_resource async

tag_resource(
    resource_arn: AssociationArn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncCodeGuruReviewerClientConfig] = None,
) -> TagResourceResponse

Adds one or more tags to an associated repository.

Parameters:

  • resource_arn (AssociationArn) –

    The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.

  • tags (TagMap) –

    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, or Secret). 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.

Raises:

Source code in docs_src/capo_codeguru_reviewer/_services/async_code_guru_reviewer.py
async def tag_resource(
    self,
    resource_arn: "capo_codeguru_reviewer.types.association_arn.AssociationArn",
    tags: "capo_codeguru_reviewer.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncCodeGuruReviewerClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeguru_reviewer.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_reviewer.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_codeguru_reviewer._operations.aws_guru_frontend_service.tag_resource

        (
            output,
            http_response,
        ) = await capo_codeguru_reviewer._operations.aws_guru_frontend_service.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output