Class: Pago::V2026_04::Models::SubscriptionPause
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ pause_at_period_end: "pause_at_period_end", resumes_at: "resumes_at" }.freeze
- REQUIRED_KEYS =
["pause_at_period_end"].freeze
Instance Attribute Summary collapse
-
#pause_at_period_end ⇒ Boolean
readonly
Pause an active subscription at the end of the current period.
-
#resumes_at ⇒ String?
readonly
Date at which the paused subscription should automatically resume.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pause_at_period_end:, resumes_at: ::Pago::UNSET) ⇒ SubscriptionPause
constructor
A new instance of SubscriptionPause.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(pause_at_period_end:, resumes_at: ::Pago::UNSET) ⇒ SubscriptionPause
Returns a new instance of SubscriptionPause.
41110 41111 41112 41113 41114 41115 41116 41117 |
# File 'lib/pago/v2026_04/models.rb', line 41110 def initialize( pause_at_period_end:, resumes_at: ::Pago::UNSET ) super() assign(:pause_at_period_end, pause_at_period_end) assign(:resumes_at, resumes_at) end |
Instance Attribute Details
#pause_at_period_end ⇒ Boolean (readonly)
Pause an active subscription at the end of the current period.
Or cancel a scheduled pause on a subscription set to be paused at period end.
41101 41102 41103 |
# File 'lib/pago/v2026_04/models.rb', line 41101 def pause_at_period_end @pause_at_period_end end |
#resumes_at ⇒ String? (readonly)
Date at which the paused subscription should automatically resume.
If not set, the subscription stays paused until it is resumed manually. Must be after the current period end.
41108 41109 41110 |
# File 'lib/pago/v2026_04/models.rb', line 41108 def resumes_at @resumes_at end |
Class Method Details
.from_json(data) ⇒ SubscriptionPause?
41121 41122 41123 41124 41125 41126 41127 41128 41129 41130 41131 41132 41133 |
# File 'lib/pago/v2026_04/models.rb', line 41121 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( pause_at_period_end: (data.key?("pause_at_period_end") ? data["pause_at_period_end"] : ::Pago::UNSET), resumes_at: (data.key?("resumes_at") ? data["resumes_at"] : ::Pago::UNSET) ), data ) end |