Skip to content

tag_resource async

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

Adds or updates tags for the AWS resource with the specified ARN.

Parameters:

  • resource_arn (ResourceArn) –

    The ARN of the resource to be tagged. The ARN must be URL-encoded.

  • tags (Tags) –

    Array of tags to be added or updated. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.

Raises:

Source code in docs_src/capo_ivschat/_services/async_ivschat.py
async def tag_resource(
    self,
    resource_arn: "capo_ivschat.types.resource_arn.ResourceArn",
    tags: "capo_ivschat.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncivschatClientConfig] = None,
) -> "capo_ivschat.types.tag_resource_response.TagResourceResponse":
    """<p>Adds or updates tags for the AWS resource with the specified ARN.</p>

    Args:
        resource_arn: <p>The ARN of the resource to be tagged. The ARN must be URL-encoded.</p>
        tags: <p>Array of tags to be added or updated. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.</p>

    Raises:
        capo_ivschat.errors.internal_server_exception.InternalServerException: <p/>
        capo_ivschat.errors.resource_not_found_exception.ResourceNotFoundException: <p/>
        capo_ivschat.errors.validation_exception.ValidationException: <p/>
        capo_ivschat.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_ivschat._operations.amazon_interactive_video_service_chat.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_ivschat.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