Class: Pago::V2026_04::Models::CustomerSubscriptionPause
- 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) ⇒ CustomerSubscriptionPause
constructor
A new instance of CustomerSubscriptionPause.
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) ⇒ CustomerSubscriptionPause
Returns a new instance of CustomerSubscriptionPause.
21238 21239 21240 21241 21242 21243 21244 21245 |
# File 'lib/pago/v2026_04/models.rb', line 21238 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.
21232 21233 21234 |
# File 'lib/pago/v2026_04/models.rb', line 21232 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, it stays paused until resumed. Must be after the current period end.
21236 21237 21238 |
# File 'lib/pago/v2026_04/models.rb', line 21236 def resumes_at @resumes_at end |
Class Method Details
.from_json(data) ⇒ CustomerSubscriptionPause?
21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 |
# File 'lib/pago/v2026_04/models.rb', line 21249 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 |