Skip to content

tag_resource async

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

Tags a resource with user-supplied tags.

Parameters:

  • resource_arn (ResourceArn) –

    The GraphqlApi Amazon Resource Name (ARN).

  • tags (TagMap) –

    A TagMap object.

Raises:

Source code in docs_src/capo_appsync/_services/async_app_sync.py
async def tag_resource(
    self,
    resource_arn: "capo_appsync.types.resource_arn.ResourceArn",
    tags: "capo_appsync.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncAppSyncClientConfig] = None,
) -> "capo_appsync.types.tag_resource_response.TagResourceResponse":
    """<p>Tags a resource with user-supplied tags.</p>

    Args:
        resource_arn: <p>The <code>GraphqlApi</code> Amazon Resource Name (ARN).</p>
        tags: <p>A <code>TagMap</code> object.</p>

    Raises:
        capo_appsync.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to perform this operation on this resource.</p>
        capo_appsync.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>
        capo_appsync.errors.internal_failure_exception.InternalFailureException: <p>An internal AppSync error occurred. Try your request again.</p>
        capo_appsync.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded a limit. Try your request again.</p>
        capo_appsync.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource, and then try again.</p>
        capo_appsync.errors.unauthorized_exception.UnauthorizedException: <p>You aren't authorized to perform this operation.</p>
        capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_appsync._operations.aws_deepdish_control_plane_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_appsync.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