Class: Pago::V2026_04::Models::CustomerSubscriptionPause

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  pause_at_period_end: "pause_at_period_end",
  resumes_at: "resumes_at"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["pause_at_period_end"].freeze

Instance Attribute Summary collapse

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(pause_at_period_end:, resumes_at: ::Pago::UNSET) ⇒ CustomerSubscriptionPause

Returns a new instance of CustomerSubscriptionPause.

Parameters:

  • pause_at_period_end: (Boolean)
  • resumes_at: (String, nil) (defaults to: ::Pago::UNSET)


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_endBoolean (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.

Returns:

  • (Boolean)


21232
21233
21234
# File 'lib/pago/v2026_04/models.rb', line 21232

def pause_at_period_end
  @pause_at_period_end
end

#resumes_atString? (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.

Returns:

  • (String, nil)


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?

Parameters:

  • data (Hash, String, nil)

Returns:



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