Class: Pago::V2026_04::Models::OrderSubscription
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", 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 =
["metadata", "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.
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#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(metadata:, 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:) ⇒ OrderSubscription
Returns a new instance of OrderSubscription.
33490 33491 33492 33493 33494 33495 33496 33497 33498 33499 33500 33501 33502 33503 33504 33505 33506 33507 33508 33509 33510 33511 33512 33513 33514 33515 33516 33517 33518 33519 33520 33521 33522 33523 33524 33525 33526 33527 33528 33529 33530 33531 33532 33533 33534 33535 33536 33537 33538 33539 33540 33541 33542 33543 33544 33545 33546 33547 33548 33549 33550 33551 33552 33553 33554 33555 |
# File 'lib/pago/v2026_04/models.rb', line 33490 def initialize( metadata:, 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(:metadata, ) 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.
33389 33390 33391 |
# File 'lib/pago/v2026_04/models.rb', line 33389 def amount @amount end |
#cancel_at_period_end ⇒ Boolean (readonly)
Whether the subscription will be canceled at the end of the current period.
33431 33432 33433 |
# File 'lib/pago/v2026_04/models.rb', line 33431 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.
33435 33436 33437 |
# File 'lib/pago/v2026_04/models.rb', line 33435 def canceled_at @canceled_at end |
#checkout_id ⇒ String? (readonly)
33478 33479 33480 |
# File 'lib/pago/v2026_04/models.rb', line 33478 def checkout_id @checkout_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
33377 33378 33379 |
# File 'lib/pago/v2026_04/models.rb', line 33377 def created_at @created_at end |
#currency ⇒ String (readonly)
The currency of the subscription.
33393 33394 33395 |
# File 'lib/pago/v2026_04/models.rb', line 33393 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.
33419 33420 33421 |
# File 'lib/pago/v2026_04/models.rb', line 33419 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.
33415 33416 33417 |
# File 'lib/pago/v2026_04/models.rb', line 33415 def current_meter_period_start @current_meter_period_start end |
#current_period_end ⇒ String (readonly)
The end timestamp of the current billing period.
33411 33412 33413 |
# File 'lib/pago/v2026_04/models.rb', line 33411 def current_period_end @current_period_end end |
#current_period_start ⇒ String (readonly)
The start timestamp of the current billing period.
33407 33408 33409 |
# File 'lib/pago/v2026_04/models.rb', line 33407 def current_period_start @current_period_start end |
#customer_cancellation_comment ⇒ String? (readonly)
33488 33489 33490 |
# File 'lib/pago/v2026_04/models.rb', line 33488 def customer_cancellation_comment @customer_cancellation_comment end |
#customer_cancellation_reason ⇒ String? (readonly)
33485 33486 33487 |
# File 'lib/pago/v2026_04/models.rb', line 33485 def customer_cancellation_reason @customer_cancellation_reason end |
#customer_id ⇒ String (readonly)
The ID of the subscribed customer.
33467 33468 33469 |
# File 'lib/pago/v2026_04/models.rb', line 33467 def customer_id @customer_id end |
#discount_id ⇒ String? (readonly)
The ID of the applied discount, if any.
33475 33476 33477 |
# File 'lib/pago/v2026_04/models.rb', line 33475 def discount_id @discount_id end |
#ended_at ⇒ String? (readonly)
The timestamp when the subscription ended.
33447 33448 33449 |
# File 'lib/pago/v2026_04/models.rb', line 33447 def ended_at @ended_at end |
#ends_at ⇒ String? (readonly)
The timestamp when the subscription will end.
33443 33444 33445 |
# File 'lib/pago/v2026_04/models.rb', line 33443 def ends_at @ends_at end |
#id ⇒ String (readonly)
The ID of the object.
33385 33386 33387 |
# File 'lib/pago/v2026_04/models.rb', line 33385 def id @id end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
33373 33374 33375 |
# File 'lib/pago/v2026_04/models.rb', line 33373 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
33381 33382 33383 |
# File 'lib/pago/v2026_04/models.rb', line 33381 def modified_at @modified_at end |
#past_due_at ⇒ String? (readonly)
The timestamp when the subscription entered past_due status.
33451 33452 33453 |
# File 'lib/pago/v2026_04/models.rb', line 33451 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.
33455 33456 33457 |
# File 'lib/pago/v2026_04/models.rb', line 33455 def pause_at_period_end @pause_at_period_end end |
#paused_at ⇒ String? (readonly)
The timestamp when the subscription was paused.
33459 33460 33461 |
# File 'lib/pago/v2026_04/models.rb', line 33459 def paused_at @paused_at end |
#product_id ⇒ String (readonly)
The ID of the subscribed product.
33471 33472 33473 |
# File 'lib/pago/v2026_04/models.rb', line 33471 def product_id @product_id end |
#recurring_interval ⇒ String (readonly)
33396 33397 33398 |
# File 'lib/pago/v2026_04/models.rb', line 33396 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.
33400 33401 33402 |
# File 'lib/pago/v2026_04/models.rb', line 33400 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.
33463 33464 33465 |
# File 'lib/pago/v2026_04/models.rb', line 33463 def resumes_at @resumes_at end |
#seats ⇒ Integer? (readonly)
The number of seats for seat-based subscriptions. None for non-seat subscriptions.
33482 33483 33484 |
# File 'lib/pago/v2026_04/models.rb', line 33482 def seats @seats end |
#started_at ⇒ String? (readonly)
The timestamp when the subscription started.
33439 33440 33441 |
# File 'lib/pago/v2026_04/models.rb', line 33439 def started_at @started_at end |
#status ⇒ String (readonly)
33403 33404 33405 |
# File 'lib/pago/v2026_04/models.rb', line 33403 def status @status end |
#trial_end ⇒ String? (readonly)
The end timestamp of the trial period, if any.
33427 33428 33429 |
# File 'lib/pago/v2026_04/models.rb', line 33427 def trial_end @trial_end end |
#trial_start ⇒ String? (readonly)
The start timestamp of the trial period, if any.
33423 33424 33425 |
# File 'lib/pago/v2026_04/models.rb', line 33423 def trial_start @trial_start end |
Class Method Details
.from_json(data) ⇒ OrderSubscription?
33559 33560 33561 33562 33563 33564 33565 33566 33567 33568 33569 33570 33571 33572 33573 33574 33575 33576 33577 33578 33579 33580 33581 33582 33583 33584 33585 33586 33587 33588 33589 33590 33591 33592 33593 33594 33595 33596 33597 33598 33599 33600 |
# File 'lib/pago/v2026_04/models.rb', line 33559 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( metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), 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 |