createOrder method

Future<CreateOrderOutput> createOrder({
  1. required String outpostIdentifier,
  2. required PaymentOption paymentOption,
  3. List<LineItemRequest>? lineItems,
  4. PaymentTerm? paymentTerm,
  5. String? quoteIdentifier,
  6. String? quoteOptionIdentifier,
})

Creates an order for an Outpost.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw NotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter outpostIdentifier : The ID or the Amazon Resource Name (ARN) of the Outpost.

Parameter paymentOption : The payment option.

Parameter lineItems : The line items that make up the order.

Parameter paymentTerm : The payment terms.

Parameter quoteIdentifier : The ID of the quote to use for the order.

Parameter quoteOptionIdentifier : The ID of the quote option to use for the order.

Implementation

Future<CreateOrderOutput> createOrder({
  required String outpostIdentifier,
  required PaymentOption paymentOption,
  List<LineItemRequest>? lineItems,
  PaymentTerm? paymentTerm,
  String? quoteIdentifier,
  String? quoteOptionIdentifier,
}) async {
  final $payload = <String, dynamic>{
    'OutpostIdentifier': outpostIdentifier,
    'PaymentOption': paymentOption.value,
    if (lineItems != null) 'LineItems': lineItems,
    if (paymentTerm != null) 'PaymentTerm': paymentTerm.value,
    if (quoteIdentifier != null) 'QuoteIdentifier': quoteIdentifier,
    if (quoteOptionIdentifier != null)
      'QuoteOptionIdentifier': quoteOptionIdentifier,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/orders',
    exceptionFnMap: _exceptionFns,
  );
  return CreateOrderOutput.fromJson(response);
}