Class: Pago::V2026_04::Models::SubscriptionUpdateBase
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ product_id: "product_id", proration_behavior: "proration_behavior", discount_id: "discount_id", trial_end: "trial_end" }.freeze
- REQUIRED_KEYS =
[].freeze
Instance Attribute Summary collapse
-
#discount_id ⇒ String?
readonly
Update the subscription to apply a new discount.
-
#product_id ⇒ String?
readonly
Update subscription to another product.
-
#proration_behavior ⇒ String?
readonly
Determine how to handle the proration billing.
-
#trial_end ⇒ String?
readonly
Set or extend the trial period of the subscription.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(product_id: ::Pago::UNSET, proration_behavior: ::Pago::UNSET, discount_id: ::Pago::UNSET, trial_end: ::Pago::UNSET) ⇒ SubscriptionUpdateBase
constructor
A new instance of SubscriptionUpdateBase.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(product_id: ::Pago::UNSET, proration_behavior: ::Pago::UNSET, discount_id: ::Pago::UNSET, trial_end: ::Pago::UNSET) ⇒ SubscriptionUpdateBase
Returns a new instance of SubscriptionUpdateBase.
42674 42675 42676 42677 42678 42679 42680 42681 42682 42683 42684 42685 |
# File 'lib/pago/v2026_04/models.rb', line 42674 def initialize( product_id: ::Pago::UNSET, proration_behavior: ::Pago::UNSET, discount_id: ::Pago::UNSET, trial_end: ::Pago::UNSET ) super() assign(:product_id, product_id) assign(:proration_behavior, proration_behavior) assign(:discount_id, discount_id) assign(:trial_end, trial_end) end |
Instance Attribute Details
#discount_id ⇒ String? (readonly)
Update the subscription to apply a new discount. If set to null, the discount will be removed. The change will be applied on the next billing cycle.
42668 42669 42670 |
# File 'lib/pago/v2026_04/models.rb', line 42668 def discount_id @discount_id end |
#product_id ⇒ String? (readonly)
Update subscription to another product.
42660 42661 42662 |
# File 'lib/pago/v2026_04/models.rb', line 42660 def product_id @product_id end |
#proration_behavior ⇒ String? (readonly)
Determine how to handle the proration billing. If not provided, will use the default organization setting.
42664 42665 42666 |
# File 'lib/pago/v2026_04/models.rb', line 42664 def proration_behavior @proration_behavior end |
#trial_end ⇒ String? (readonly)
Set or extend the trial period of the subscription. If set to now, the trial will end immediately.
42672 42673 42674 |
# File 'lib/pago/v2026_04/models.rb', line 42672 def trial_end @trial_end end |
Class Method Details
.from_json(data) ⇒ SubscriptionUpdateBase?
42689 42690 42691 42692 42693 42694 42695 42696 42697 42698 42699 42700 42701 42702 42703 |
# File 'lib/pago/v2026_04/models.rb', line 42689 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( product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET), proration_behavior: (data.key?("proration_behavior") ? data["proration_behavior"] : ::Pago::UNSET), discount_id: (data.key?("discount_id") ? data["discount_id"] : ::Pago::UNSET), trial_end: (data.key?("trial_end") ? data["trial_end"] : ::Pago::UNSET) ), data ) end |