Class: Pago::V2026_04::Models::CustomerOrderSubscription
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ created_at: "created_at", modified_at: "modified_at", id: "id", amount: "amount", currency: "currency", recurring_interval: "recurring_interval", recurring_interval_count: "recurring_interval_count", status: "status", current_period_start: "current_period_start", current_period_end: "current_period_end", current_meter_period_start: "current_meter_period_start", current_meter_period_end: "current_meter_period_end", trial_start: "trial_start", trial_end: "trial_end", cancel_at_period_end: "cancel_at_period_end", canceled_at: "canceled_at", started_at: "started_at", ends_at: "ends_at", ended_at: "ended_at", past_due_at: "past_due_at", pause_at_period_end: "pause_at_period_end", paused_at: "paused_at", resumes_at: "resumes_at", customer_id: "customer_id", product_id: "product_id", discount_id: "discount_id", checkout_id: "checkout_id", seats: "seats", customer_cancellation_reason: "customer_cancellation_reason", customer_cancellation_comment: "customer_cancellation_comment" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "amount", "currency", "recurring_interval", "recurring_interval_count", "status", "current_period_start", "current_period_end", "current_meter_period_start", "current_meter_period_end", "trial_start", "trial_end", "cancel_at_period_end", "canceled_at", "started_at", "ends_at", "ended_at", "pause_at_period_end", "paused_at", "resumes_at", "customer_id", "product_id", "discount_id", "checkout_id", "customer_cancellation_reason", "customer_cancellation_comment"].freeze
Instance Attribute Summary collapse
-
#amount ⇒ Integer
readonly
The amount of the subscription.
-
#cancel_at_period_end ⇒ Boolean
readonly
Whether the subscription will be canceled at the end of the current period.
-
#canceled_at ⇒ String?
readonly
The timestamp when the subscription was canceled.
- #checkout_id ⇒ String? readonly
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#currency ⇒ String
readonly
The currency of the subscription.
-
#current_meter_period_end ⇒ String?
readonly
The end timestamp of the current meter period, if the product has a meter cycle set.
-
#current_meter_period_start ⇒ String?
readonly
The start timestamp of the current meter period, if the product has a meter cycle set.
-
#current_period_end ⇒ String
readonly
The end timestamp of the current billing period.
-
#current_period_start ⇒ String
readonly
The start timestamp of the current billing period.
- #customer_cancellation_comment ⇒ String? readonly
- #customer_cancellation_reason ⇒ String? readonly
-
#customer_id ⇒ String
readonly
The ID of the subscribed customer.
-
#discount_id ⇒ String?
readonly
The ID of the applied discount, if any.
-
#ended_at ⇒ String?
readonly
The timestamp when the subscription ended.
-
#ends_at ⇒ String?
readonly
The timestamp when the subscription will end.
-
#id ⇒ String
readonly
The ID of the object.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#past_due_at ⇒ String?
readonly
The timestamp when the subscription entered
past_duestatus. -
#pause_at_period_end ⇒ Boolean
readonly
Whether the subscription will be paused at the end of the current period.
-
#paused_at ⇒ String?
readonly
The timestamp when the subscription was paused.
-
#product_id ⇒ String
readonly
The ID of the subscribed product.
- #recurring_interval ⇒ String readonly
-
#recurring_interval_count ⇒ Integer
readonly
Number of interval units of the subscription.
-
#resumes_at ⇒ String?
readonly
The timestamp when a paused subscription is scheduled to automatically resume, if set.
-
#seats ⇒ Integer?
readonly
The number of seats for seat-based subscriptions.
-
#started_at ⇒ String?
readonly
The timestamp when the subscription started.
- #status ⇒ String readonly
-
#trial_end ⇒ String?
readonly
The end timestamp of the trial period, if any.
-
#trial_start ⇒ String?
readonly
The start timestamp of the trial period, if any.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(created_at:, modified_at:, id:, amount:, currency:, recurring_interval:, recurring_interval_count:, status:, current_period_start:, current_period_end:, current_meter_period_start:, current_meter_period_end:, trial_start:, trial_end:, cancel_at_period_end:, canceled_at:, started_at:, ends_at:, ended_at:, past_due_at: ::Pago::UNSET, pause_at_period_end:, paused_at:, resumes_at:, customer_id:, product_id:, discount_id:, checkout_id:, seats: ::Pago::UNSET, customer_cancellation_reason:, customer_cancellation_comment:) ⇒ CustomerOrderSubscription
Returns a new instance of CustomerOrderSubscription.
18106 18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 18130 18131 18132 18133 18134 18135 18136 18137 18138 18139 18140 18141 18142 18143 18144 18145 18146 18147 18148 18149 18150 18151 18152 18153 18154 18155 18156 18157 18158 18159 18160 18161 18162 18163 18164 18165 18166 18167 18168 18169 |
# File 'lib/pago/v2026_04/models.rb', line 18106 def initialize( created_at:, modified_at:, id:, amount:, currency:, recurring_interval:, recurring_interval_count:, status:, current_period_start:, current_period_end:, current_meter_period_start:, current_meter_period_end:, trial_start:, trial_end:, cancel_at_period_end:, canceled_at:, started_at:, ends_at:, ended_at:, past_due_at: ::Pago::UNSET, pause_at_period_end:, paused_at:, resumes_at:, customer_id:, product_id:, discount_id:, checkout_id:, seats: ::Pago::UNSET, customer_cancellation_reason:, customer_cancellation_comment: ) super() assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:amount, amount) assign(:currency, currency) assign(:recurring_interval, recurring_interval) assign(:recurring_interval_count, recurring_interval_count) assign(:status, status) assign(:current_period_start, current_period_start) assign(:current_period_end, current_period_end) assign(:current_meter_period_start, current_meter_period_start) assign(:current_meter_period_end, current_meter_period_end) assign(:trial_start, trial_start) assign(:trial_end, trial_end) assign(:cancel_at_period_end, cancel_at_period_end) assign(:canceled_at, canceled_at) assign(:started_at, started_at) assign(:ends_at, ends_at) assign(:ended_at, ended_at) assign(:past_due_at, past_due_at) assign(:pause_at_period_end, pause_at_period_end) assign(:paused_at, paused_at) assign(:resumes_at, resumes_at) assign(:customer_id, customer_id) assign(:product_id, product_id) assign(:discount_id, discount_id) assign(:checkout_id, checkout_id) assign(:seats, seats) assign(:customer_cancellation_reason, customer_cancellation_reason) assign(:customer_cancellation_comment, customer_cancellation_comment) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
The amount of the subscription.
18005 18006 18007 |
# File 'lib/pago/v2026_04/models.rb', line 18005 def amount @amount end |
#cancel_at_period_end ⇒ Boolean (readonly)
Whether the subscription will be canceled at the end of the current period.
18047 18048 18049 |
# File 'lib/pago/v2026_04/models.rb', line 18047 def cancel_at_period_end @cancel_at_period_end end |
#canceled_at ⇒ String? (readonly)
The timestamp when the subscription was canceled. The subscription might still be active if cancel_at_period_end is true.
18051 18052 18053 |
# File 'lib/pago/v2026_04/models.rb', line 18051 def canceled_at @canceled_at end |
#checkout_id ⇒ String? (readonly)
18094 18095 18096 |
# File 'lib/pago/v2026_04/models.rb', line 18094 def checkout_id @checkout_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
17993 17994 17995 |
# File 'lib/pago/v2026_04/models.rb', line 17993 def created_at @created_at end |
#currency ⇒ String (readonly)
The currency of the subscription.
18009 18010 18011 |
# File 'lib/pago/v2026_04/models.rb', line 18009 def currency @currency end |
#current_meter_period_end ⇒ String? (readonly)
The end timestamp of the current meter period, if the product has a meter cycle set. This is when credits next renew.
18035 18036 18037 |
# File 'lib/pago/v2026_04/models.rb', line 18035 def current_meter_period_end @current_meter_period_end end |
#current_meter_period_start ⇒ String? (readonly)
The start timestamp of the current meter period, if the product has a meter cycle set. Metered credits are granted and overage is settled on this cadence.
18031 18032 18033 |
# File 'lib/pago/v2026_04/models.rb', line 18031 def current_meter_period_start @current_meter_period_start end |
#current_period_end ⇒ String (readonly)
The end timestamp of the current billing period.
18027 18028 18029 |
# File 'lib/pago/v2026_04/models.rb', line 18027 def current_period_end @current_period_end end |
#current_period_start ⇒ String (readonly)
The start timestamp of the current billing period.
18023 18024 18025 |
# File 'lib/pago/v2026_04/models.rb', line 18023 def current_period_start @current_period_start end |
#customer_cancellation_comment ⇒ String? (readonly)
18104 18105 18106 |
# File 'lib/pago/v2026_04/models.rb', line 18104 def customer_cancellation_comment @customer_cancellation_comment end |
#customer_cancellation_reason ⇒ String? (readonly)
18101 18102 18103 |
# File 'lib/pago/v2026_04/models.rb', line 18101 def customer_cancellation_reason @customer_cancellation_reason end |
#customer_id ⇒ String (readonly)
The ID of the subscribed customer.
18083 18084 18085 |
# File 'lib/pago/v2026_04/models.rb', line 18083 def customer_id @customer_id end |
#discount_id ⇒ String? (readonly)
The ID of the applied discount, if any.
18091 18092 18093 |
# File 'lib/pago/v2026_04/models.rb', line 18091 def discount_id @discount_id end |
#ended_at ⇒ String? (readonly)
The timestamp when the subscription ended.
18063 18064 18065 |
# File 'lib/pago/v2026_04/models.rb', line 18063 def ended_at @ended_at end |
#ends_at ⇒ String? (readonly)
The timestamp when the subscription will end.
18059 18060 18061 |
# File 'lib/pago/v2026_04/models.rb', line 18059 def ends_at @ends_at end |
#id ⇒ String (readonly)
The ID of the object.
18001 18002 18003 |
# File 'lib/pago/v2026_04/models.rb', line 18001 def id @id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
17997 17998 17999 |
# File 'lib/pago/v2026_04/models.rb', line 17997 def modified_at @modified_at end |
#past_due_at ⇒ String? (readonly)
The timestamp when the subscription entered past_due status.
18067 18068 18069 |
# File 'lib/pago/v2026_04/models.rb', line 18067 def past_due_at @past_due_at end |
#pause_at_period_end ⇒ Boolean (readonly)
Whether the subscription will be paused at the end of the current period.
18071 18072 18073 |
# File 'lib/pago/v2026_04/models.rb', line 18071 def pause_at_period_end @pause_at_period_end end |
#paused_at ⇒ String? (readonly)
The timestamp when the subscription was paused.
18075 18076 18077 |
# File 'lib/pago/v2026_04/models.rb', line 18075 def paused_at @paused_at end |
#product_id ⇒ String (readonly)
The ID of the subscribed product.
18087 18088 18089 |
# File 'lib/pago/v2026_04/models.rb', line 18087 def product_id @product_id end |
#recurring_interval ⇒ String (readonly)
18012 18013 18014 |
# File 'lib/pago/v2026_04/models.rb', line 18012 def recurring_interval @recurring_interval end |
#recurring_interval_count ⇒ Integer (readonly)
Number of interval units of the subscription. If this is set to 1 the charge will happen every interval (e.g. every month), if set to 2 it will be every other month, and so on.
18016 18017 18018 |
# File 'lib/pago/v2026_04/models.rb', line 18016 def recurring_interval_count @recurring_interval_count end |
#resumes_at ⇒ String? (readonly)
The timestamp when a paused subscription is scheduled to automatically resume, if set.
18079 18080 18081 |
# File 'lib/pago/v2026_04/models.rb', line 18079 def resumes_at @resumes_at end |
#seats ⇒ Integer? (readonly)
The number of seats for seat-based subscriptions. None for non-seat subscriptions.
18098 18099 18100 |
# File 'lib/pago/v2026_04/models.rb', line 18098 def seats @seats end |
#started_at ⇒ String? (readonly)
The timestamp when the subscription started.
18055 18056 18057 |
# File 'lib/pago/v2026_04/models.rb', line 18055 def started_at @started_at end |
#status ⇒ String (readonly)
18019 18020 18021 |
# File 'lib/pago/v2026_04/models.rb', line 18019 def status @status end |
#trial_end ⇒ String? (readonly)
The end timestamp of the trial period, if any.
18043 18044 18045 |
# File 'lib/pago/v2026_04/models.rb', line 18043 def trial_end @trial_end end |
#trial_start ⇒ String? (readonly)
The start timestamp of the trial period, if any.
18039 18040 18041 |
# File 'lib/pago/v2026_04/models.rb', line 18039 def trial_start @trial_start end |
Class Method Details
.from_json(data) ⇒ CustomerOrderSubscription?
18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 |
# File 'lib/pago/v2026_04/models.rb', line 18173 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), id: (data.key?("id") ? data["id"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET), recurring_interval: (data.key?("recurring_interval") ? data["recurring_interval"] : ::Pago::UNSET), recurring_interval_count: (data.key?("recurring_interval_count") ? data["recurring_interval_count"] : ::Pago::UNSET), status: (data.key?("status") ? data["status"] : ::Pago::UNSET), current_period_start: (data.key?("current_period_start") ? data["current_period_start"] : ::Pago::UNSET), current_period_end: (data.key?("current_period_end") ? data["current_period_end"] : ::Pago::UNSET), current_meter_period_start: (data.key?("current_meter_period_start") ? data["current_meter_period_start"] : ::Pago::UNSET), current_meter_period_end: (data.key?("current_meter_period_end") ? data["current_meter_period_end"] : ::Pago::UNSET), trial_start: (data.key?("trial_start") ? data["trial_start"] : ::Pago::UNSET), trial_end: (data.key?("trial_end") ? data["trial_end"] : ::Pago::UNSET), cancel_at_period_end: (data.key?("cancel_at_period_end") ? data["cancel_at_period_end"] : ::Pago::UNSET), canceled_at: (data.key?("canceled_at") ? data["canceled_at"] : ::Pago::UNSET), started_at: (data.key?("started_at") ? data["started_at"] : ::Pago::UNSET), ends_at: (data.key?("ends_at") ? data["ends_at"] : ::Pago::UNSET), ended_at: (data.key?("ended_at") ? data["ended_at"] : ::Pago::UNSET), past_due_at: (data.key?("past_due_at") ? data["past_due_at"] : ::Pago::UNSET), pause_at_period_end: (data.key?("pause_at_period_end") ? data["pause_at_period_end"] : ::Pago::UNSET), paused_at: (data.key?("paused_at") ? data["paused_at"] : ::Pago::UNSET), resumes_at: (data.key?("resumes_at") ? data["resumes_at"] : ::Pago::UNSET), customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET), product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET), discount_id: (data.key?("discount_id") ? data["discount_id"] : ::Pago::UNSET), checkout_id: (data.key?("checkout_id") ? data["checkout_id"] : ::Pago::UNSET), seats: (data.key?("seats") ? data["seats"] : ::Pago::UNSET), customer_cancellation_reason: (data.key?("customer_cancellation_reason") ? data["customer_cancellation_reason"] : ::Pago::UNSET), customer_cancellation_comment: (data.key?("customer_cancellation_comment") ? data["customer_cancellation_comment"] : ::Pago::UNSET) ), data ) end |