Skip to content

tag_resource async

tag_resource(
    resource_arn: Arn,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncrepostspaceClientConfig] = None,
) -> TagResourceResponse

Associates tags with an AWS re:Post Private resource. Currently, the only resource that can be tagged is the private re:Post. If you specify a new tag key for the resource, the tag is appended to the list of tags that are associated with the resource. If you specify a tag key that’s already associated with the resource, the new tag value that you specify replaces the previous value for that tag.

Parameters:

  • resource_arn (Arn) –

    The ARN of the resource that the tag is associated with.

  • tags (Tags) –

    The list of tag keys and values that must be associated with the resource. You can associate tag keys only, tags (key and values) only, or a combination of tag keys and tags.

Raises:

Source code in docs_src/capo_repostspace/_services/async_repostspace.py
async def tag_resource(
    self,
    resource_arn: "capo_repostspace.types.arn.Arn",
    tags: "capo_repostspace.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncrepostspaceClientConfig] = None,
) -> "capo_repostspace.types.tag_resource_response.TagResourceResponse":
    """<p>Associates tags with an AWS re:Post Private resource. Currently, the only resource that can be tagged is the private re:Post. If you specify a new tag key for the resource, the tag is appended to the list of tags that are associated with the resource. If you specify a tag key that’s already associated with the resource, the new tag value that you specify replaces the previous value for that tag.</p>

    Args:
        resource_arn: <p>The ARN of the resource that the tag is associated with.</p>
        tags: <p>The list of tag keys and values that must be associated with the resource. You can associate tag keys only, tags (key and values) only, or a combination of tag keys and tags.</p>

    Raises:
        capo_repostspace.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_repostspace.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_repostspace.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_repostspace.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_repostspace.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_repostspace.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_repostspace._operations.repost_space.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_repostspace.types.tag_resource_request.TagResourceRequest",
    ) -> dict[str, Any]:
        import capo_repostspace.types.tag_resource_request

        return capo_repostspace.types.tag_resource_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("TagResource", redact_input=_redact_input),
    )
    input_: capo_repostspace.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