Class: TerminalShop::Models::SubscriptionAPI

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

Direct Known Subclasses

SubscriptionCreateParams

Defined Under Namespace

Modules: Schedule

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(id:, address_id:, card_id:, created:, price:, product_variant_id:, quantity:, next_: nil, schedule: nil) ⇒ Object

Some parameter documentations has been truncated, see TerminalShop::Models::SubscriptionAPI for more details.

Subscription to a Terminal shop product.

Parameters:

  • id (String)

    Unique object identifier.

  • address_id (String)

    ID of the shipping address used for the subscription.

  • card_id (String)

    ID of the card used for the subscription.

  • created (String)

    Date the subscription was created.

  • price (Integer)

    Price of the subscription in cents (USD).

  • product_variant_id (String)

    ID of the product variant being subscribed to.

  • quantity (Integer)

    Quantity of the subscription.

  • next_ (String) (defaults to: nil)

    Next shipment and billing date for the subscription.

  • schedule (TerminalShop::Models::SubscriptionAPI::Schedule::Fixed, TerminalShop::Models::SubscriptionAPI::Schedule::Weekly) (defaults to: nil)

    Schedule of the subscription.



# File 'lib/terminal_shop/models/subscription.rb', line 60

Instance Attribute Details

#address_idString

ID of the shipping address used for the subscription.

Returns:

  • (String)


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

required :address_id, String, api_name: :addressID

#card_idString

ID of the card used for the subscription.

Returns:

  • (String)


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

required :card_id, String, api_name: :cardID

#createdString

Date the subscription was created.

Returns:

  • (String)


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

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/subscription.rb', line 10

required :id, String

#next_String?

Next shipment and billing date for the subscription.

Returns:

  • (String, nil)


52
# File 'lib/terminal_shop/models/subscription.rb', line 52

optional :next_, String, api_name: :next

#priceInteger

Price of the subscription in cents (USD).

Returns:

  • (Integer)


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

required :price, Integer

#product_variant_idString

ID of the product variant being subscribed to.

Returns:

  • (String)


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

required :product_variant_id, String, api_name: :productVariantID

#quantityInteger

Quantity of the subscription.

Returns:

  • (Integer)


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

required :quantity, Integer

#scheduleTerminalShop::Models::SubscriptionAPI::Schedule::Fixed, ...

Schedule of the subscription.



58
# File 'lib/terminal_shop/models/subscription.rb', line 58

optional :schedule, union: -> { TerminalShop::SubscriptionAPI::Schedule }