Class: Pago::V2026_04::Models::PaymentMethodGeneric

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])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  processor: "processor",
  customer_id: "customer_id",
  type: "type"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "processor", "customer_id", "type"].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(id:, created_at:, modified_at:, processor:, customer_id:, type:) ⇒ PaymentMethodGeneric

Returns a new instance of PaymentMethodGeneric.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • processor: (String)
  • customer_id: (String)
  • type: (String)


35690
35691
35692
35693
35694
35695
35696
35697
35698
35699
35700
35701
35702
35703
35704
35705
# File 'lib/pago/v2026_04/models.rb', line 35690

def initialize(
  id:,
  created_at:,
  modified_at:,
  processor:,
  customer_id:,
  type:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:processor, processor)
  assign(:customer_id, customer_id)
  assign(:type, type)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


35675
35676
35677
# File 'lib/pago/v2026_04/models.rb', line 35675

def created_at
  @created_at
end

#customer_idString (readonly)

Returns:

  • (String)


35685
35686
35687
# File 'lib/pago/v2026_04/models.rb', line 35685

def customer_id
  @customer_id
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


35671
35672
35673
# File 'lib/pago/v2026_04/models.rb', line 35671

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


35679
35680
35681
# File 'lib/pago/v2026_04/models.rb', line 35679

def modified_at
  @modified_at
end

#processorString (readonly)

Returns:

  • (String)


35682
35683
35684
# File 'lib/pago/v2026_04/models.rb', line 35682

def processor
  @processor
end

#typeString (readonly)

Returns:

  • (String)


35688
35689
35690
# File 'lib/pago/v2026_04/models.rb', line 35688

def type
  @type
end

Class Method Details

.from_json(data) ⇒ PaymentMethodGeneric?

Parameters:

  • data (Hash, String, nil)

Returns:



35709
35710
35711
35712
35713
35714
35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
# File 'lib/pago/v2026_04/models.rb', line 35709

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