Class: Pago::V2026_04::Models::SubscriptionPause

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) ⇒ SubscriptionPause

Returns a new instance of SubscriptionPause.

Parameters:

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


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_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)


41101
41102
41103
# File 'lib/pago/v2026_04/models.rb', line 41101

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, the subscription stays paused until it is resumed manually. Must be after the current period end.

Returns:

  • (String, nil)


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?

Parameters:

  • data (Hash, String, nil)

Returns:



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