Skip to content

create_order

create_order(
    outpost_identifier: OutpostIdentifier,
    payment_option: PaymentOption,
    *,
    config_overrides: Optional[OutpostsClientConfig] = None,
    quote_identifier: Optional[QuoteIdentifier] = None,
    quote_option_identifier: Optional[QuoteOptionIdentifier] = None,
    line_items: Optional[LineItemRequestListDefinition] = None,
    payment_term: Optional[PaymentTerm] = None,
) -> CreateOrderOutput

Creates an order for an Outpost.

Parameters:

Raises:

Source code in docs_src/capo_outposts/_services/outposts.py
def create_order(
    self,
    outpost_identifier: "capo_outposts.types.outpost_identifier.OutpostIdentifier",
    payment_option: "capo_outposts.types.payment_option.PaymentOption",
    *,
    config_overrides: Optional[OutpostsClientConfig] = None,
    quote_identifier: Optional[
        "capo_outposts.types.quote_identifier.QuoteIdentifier"
    ] = None,
    quote_option_identifier: Optional[
        "capo_outposts.types.quote_option_identifier.QuoteOptionIdentifier"
    ] = None,
    line_items: Optional[
        "capo_outposts.types.line_item_request_list_definition.LineItemRequestListDefinition"
    ] = None,
    payment_term: Optional["capo_outposts.types.payment_term.PaymentTerm"] = None,
) -> "capo_outposts.types.create_order_output.CreateOrderOutput":
    """<p>Creates an order for an Outpost.</p>

    Args:
        outpost_identifier: <p> The ID or the Amazon Resource Name (ARN) of the Outpost. </p>
        quote_identifier: <p>The ID of the quote to use for the order.</p>
        quote_option_identifier: <p>The ID of the quote option to use for the order.</p>
        line_items: <p>The line items that make up the order.</p>
        payment_option: <p>The payment option.</p>
        payment_term: <p>The payment terms.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded a service quota.</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.
    """

    def _handler(
        req: "OperationRequest[capo_outposts.types.create_order_input.CreateOrderInput]",
    ) -> OperationResponse[
        "capo_outposts.types.create_order_output.CreateOrderOutput"
    ]:
        import capo_outposts._operations.outposts_olaf_service.create_order

        output, http_response = (
            capo_outposts._operations.outposts_olaf_service.create_order.create_order(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateOrder")
    )
    input_: capo_outposts.types.create_order_input.CreateOrderInput = {
        "outpost_identifier": outpost_identifier,
        "payment_option": payment_option,
    }
    if quote_identifier is not None:
        input_["quote_identifier"] = quote_identifier
    if quote_option_identifier is not None:
        input_["quote_option_identifier"] = quote_option_identifier
    if line_items is not None:
        input_["line_items"] = line_items
    if payment_term is not None:
        input_["payment_term"] = payment_term

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output