Class: TerminalShop::Models::OrderAPI

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

Defined Under Namespace

Classes: Amount, Item, Shipping

Constant Summary collapse

Tracking =

Returns:

  • (:status)

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) —

    City of the address.

  • country (String) —

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

  • name (String) —

    The recipient's name.

  • street1 (String) —

    Street of the address.

  • zip (String) —

    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

#amount ⇒ TerminalShop::Models::OrderAPI::Amount

The subtotal and shipping amounts of the order.

Parameters:

  • value (TerminalShop::OrderAPI::Amount)

Returns:



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

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

#created ⇒ String

Date the order was created.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :created, String

#id ⇒ String

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

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#index ⇒ Integer?

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

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :index, Integer

#items ⇒ Array<TerminalShop::Models::OrderAPI::Item>

Items in the order.

Parameters:

  • value (::Array[TerminalShop::OrderAPI::Item])

Returns:



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

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

#shipping ⇒ TerminalShop::Models::OrderAPI::Shipping

Shipping address of the order.

Parameters:

  • value (TerminalShop::OrderAPI::Shipping)

Returns:



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

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

#tracking ⇒ TerminalShop::Models::OrderAPI::Tracking

Tracking information of the order.

Parameters:

  • value (TerminalShop::OrderAPI::Tracking)

Returns:



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

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

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


41
# File 'sig/terminal_shop/models/order.rbs', line 41

def to_hash: -> {