Class: TerminalShop::Models::OrderAPI

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/terminal_shop/models/order.rb

Defined Under Namespace

Classes: Amount, Item, Shipping, Tracking

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(city: , country: , name: , street1: , zip: , phone: nil, province: nil, street2: nil) ⇒ Object

Shipping address of the order.

Parameters:

  • city (String) (defaults to: )

    City of the address.

  • country (String) (defaults to: )

    ISO 3166-1 alpha-2 country code of the address.

  • name (String) (defaults to: )

    The recipient’s name.

  • street1 (String) (defaults to: )

    Street of the address.

  • zip (String) (defaults to: )

    Zip code of the address.

  • phone (String) (defaults to: nil)

    Phone number of the recipient.

  • province (String) (defaults to: nil)

    Province or state of the address.

  • street2 (String) (defaults to: nil)

    Apartment, suite, etc. of the address.



# File 'lib/terminal_shop/models/order.rb', line 48


Instance Attribute Details

#amountTerminalShop::Models::OrderAPI::Amount

The subtotal and shipping amounts of the order.



16
# File 'lib/terminal_shop/models/order.rb', line 16

required :amount, -> { TerminalShop::OrderAPI::Amount }

#createdString

Date the order was created.

Returns:

  • (String)


22
# File 'lib/terminal_shop/models/order.rb', line 22

required :created, String

#idString

Unique object identifier. The format and length of IDs may change over time.

Returns:

  • (String)


10
# File 'lib/terminal_shop/models/order.rb', line 10

required :id, String

#indexInteger?

Zero-based index of the order for this user only.

Returns:

  • (Integer, nil)


46
# File 'lib/terminal_shop/models/order.rb', line 46

optional :index, Integer

#itemsArray<TerminalShop::Models::OrderAPI::Item>

Items in the order.



28
# File 'lib/terminal_shop/models/order.rb', line 28

required :items, -> { TerminalShop::Internal::Type::ArrayOf[TerminalShop::OrderAPI::Item] }

#shippingTerminalShop::Models::OrderAPI::Shipping

Shipping address of the order.



34
# File 'lib/terminal_shop/models/order.rb', line 34

required :shipping, -> { TerminalShop::OrderAPI::Shipping }

#trackingTerminalShop::Models::OrderAPI::Tracking

Tracking information of the order.



40
# File 'lib/terminal_shop/models/order.rb', line 40

required :tracking, -> { TerminalShop::OrderAPI::Tracking }