Skip to content

cancel_order async

cancel_order(
    order_id: OrderId, *, config_overrides: Optional[AsyncOutpostsClientConfig] = None
) -> CancelOrderOutput

Cancels the specified order for an Outpost.

Parameters:

  • order_id (OrderId) –

    The ID of the order.

Raises:

Source code in docs_src/capo_outposts/_services/async_outposts.py
async def cancel_order(
    self,
    order_id: "capo_outposts.types.order_id.OrderId",
    *,
    config_overrides: Optional[AsyncOutpostsClientConfig] = None,
) -> "capo_outposts.types.cancel_order_output.CancelOrderOutput":
    """<p>Cancels the specified order for an Outpost.</p>

    Args:
        order_id: <p> The ID of the order. </p>

    Raises:
        capo_outposts.errors.access_denied_exception.AccessDeniedException: <p>You do not have permission to perform this operation.</p>
        capo_outposts.errors.conflict_exception.ConflictException: <p>Updating or deleting this resource can cause an inconsistent state.</p>
        capo_outposts.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred.</p>
        capo_outposts.errors.not_found_exception.NotFoundException: <p>The specified request is not valid.</p>
        capo_outposts.errors.validation_exception.ValidationException: <p>A parameter is not valid.</p>
        capo_outposts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_outposts.types.cancel_order_input.CancelOrderInput]",
    ) -> AsyncOperationResponse[
        "capo_outposts.types.cancel_order_output.CancelOrderOutput"
    ]:
        import capo_outposts._operations.outposts_olaf_service.cancel_order

        (
            output,
            http_response,
        ) = await capo_outposts._operations.outposts_olaf_service.cancel_order.async_cancel_order(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelOrder")
    )
    input_: capo_outposts.types.cancel_order_input.CancelOrderInput = {
        "order_id": order_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output