Skip to content

tag_resource async

tag_resource(
    resource_arn: Arn,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncChimeSDKVoiceClientConfig] = None,
) -> None

Adds a tag to the specified resource.

Parameters:

  • resource_arn (Arn) –

    The ARN of the resource being tagged.

  • tags (TagList) –

    A list of the tags being added to the resource.

Raises:

Source code in docs_src/capo_chime_sdk_voice/_services/async_chime_sdk_voice.py
async def tag_resource(
    self,
    resource_arn: "capo_chime_sdk_voice.types.arn.Arn",
    tags: "capo_chime_sdk_voice.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncChimeSDKVoiceClientConfig] = None,
) -> None:
    """<p>Adds a tag to the specified resource.</p>

    Args:
        resource_arn: <p>The ARN of the resource being tagged. </p>
        tags: <p>A list of the tags being added to the resource.</p>

    Raises:
        capo_chime_sdk_voice.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_voice.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_voice.errors.not_found_exception.NotFoundException: <p>The requested resource couldn't be found.</p>
        capo_chime_sdk_voice.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>The request exceeds the resource limit.</p>
        capo_chime_sdk_voice.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_voice.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_voice.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client isn't authorized to request a resource.</p>
        capo_chime_sdk_voice.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chime_sdk_voice.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_chime_sdk_voice._operations.chime_sdk_telephony_service.tag_resource

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

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

        return capo_chime_sdk_voice.types.tag_resource_request.redact_sensitive(
            input_
        )

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