Class: Pago::V2026_04::Models::PendingSubscriptionUpdate

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

Overview

Pending update to be applied to a subscription at the beginning of the next period.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  applies_at: "applies_at",
  product_id: "product_id",
  seats: "seats"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "applies_at", "product_id", "seats"].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(created_at:, modified_at:, id:, applies_at:, product_id:, seats:) ⇒ PendingSubscriptionUpdate

Returns a new instance of PendingSubscriptionUpdate.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • applies_at: (String)
  • product_id: (String, nil)
  • seats: (Integer, nil)


35881
35882
35883
35884
35885
35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
35896
# File 'lib/pago/v2026_04/models.rb', line 35881

def initialize(
  created_at:,
  modified_at:,
  id:,
  applies_at:,
  product_id:,
  seats:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:applies_at, applies_at)
  assign(:product_id, product_id)
  assign(:seats, seats)
end

Instance Attribute Details

#applies_atString (readonly)

The date and time when the subscription update will be applied.

Returns:

  • (String)


35871
35872
35873
# File 'lib/pago/v2026_04/models.rb', line 35871

def applies_at
  @applies_at
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


35859
35860
35861
# File 'lib/pago/v2026_04/models.rb', line 35859

def created_at
  @created_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


35867
35868
35869
# File 'lib/pago/v2026_04/models.rb', line 35867

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


35863
35864
35865
# File 'lib/pago/v2026_04/models.rb', line 35863

def modified_at
  @modified_at
end

#product_idString? (readonly)

ID of the new product to apply to the subscription. If null, the product won't be changed.

Returns:

  • (String, nil)


35875
35876
35877
# File 'lib/pago/v2026_04/models.rb', line 35875

def product_id
  @product_id
end

#seatsInteger? (readonly)

Number of seats to apply to the subscription. If null, the number of seats won't be changed.

Returns:

  • (Integer, nil)


35879
35880
35881
# File 'lib/pago/v2026_04/models.rb', line 35879

def seats
  @seats
end

Class Method Details

.from_json(data) ⇒ PendingSubscriptionUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



35900
35901
35902
35903
35904
35905
35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
# File 'lib/pago/v2026_04/models.rb', line 35900

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(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      applies_at: (data.key?("applies_at") ? data["applies_at"] : ::Pago::UNSET),
      product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET),
      seats: (data.key?("seats") ? data["seats"] : ::Pago::UNSET)
    ),
    data
  )
end