Skip to content

tag_resource async

tag_resource(
    resource_arn: TaggableResourceArn,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncBedrockDataAutomationClientConfig] = None,
) -> TagResourceResponse

Tag an Amazon Bedrock Data Automation resource

Raises:

Source code in docs_src/capo_bedrock_data_automation/_services/async_bedrock_data_automation.py
async def tag_resource(
    self,
    resource_arn: "capo_bedrock_data_automation.types.taggable_resource_arn.TaggableResourceArn",
    tags: "capo_bedrock_data_automation.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncBedrockDataAutomationClientConfig] = None,
) -> "capo_bedrock_data_automation.types.tag_resource_response.TagResourceResponse":
    """Tag an Amazon Bedrock Data Automation resource

    Raises:
        capo_bedrock_data_automation.errors.access_denied_exception.AccessDeniedException: This exception is thrown when a request is denied per access permissions
        capo_bedrock_data_automation.errors.internal_server_exception.InternalServerException: This exception is thrown if there was an unexpected error during processing of request
        capo_bedrock_data_automation.errors.resource_not_found_exception.ResourceNotFoundException: This exception is thrown when a resource referenced by the operation does not exist
        capo_bedrock_data_automation.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: This exception is thrown when a request is made beyond the service quota
        capo_bedrock_data_automation.errors.throttling_exception.ThrottlingException: This exception is thrown when the number of requests exceeds the limit
        capo_bedrock_data_automation.errors.validation_exception.ValidationException: This exception is thrown when the request's input validation fails
        capo_bedrock_data_automation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_bedrock_data_automation._operations.amazon_bedrock_keystone_build_time_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_bedrock_data_automation.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