Class: Pago::V2026_04::Models::CustomerCreatedMetadata

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])
{
  customer_id: "customer_id",
  customer_email: "customer_email",
  customer_name: "customer_name",
  customer_external_id: "customer_external_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["customer_id", "customer_email", "customer_name", "customer_external_id"].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(customer_id:, customer_email:, customer_name:, customer_external_id:) ⇒ CustomerCreatedMetadata

Returns a new instance of CustomerCreatedMetadata.

Parameters:

  • customer_id: (String)
  • customer_email: (String, nil)
  • customer_name: (String, nil)
  • customer_external_id: (String, nil)


16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
# File 'lib/pago/v2026_04/models.rb', line 16366

def initialize(
  customer_id:,
  customer_email:,
  customer_name:,
  customer_external_id:
)
  super()
  assign(:customer_id, customer_id)
  assign(:customer_email, customer_email)
  assign(:customer_name, customer_name)
  assign(:customer_external_id, customer_external_id)
end

Instance Attribute Details

#customer_emailString? (readonly)

Returns:

  • (String, nil)


16358
16359
16360
# File 'lib/pago/v2026_04/models.rb', line 16358

def customer_email
  @customer_email
end

#customer_external_idString? (readonly)

Returns:

  • (String, nil)


16364
16365
16366
# File 'lib/pago/v2026_04/models.rb', line 16364

def customer_external_id
  @customer_external_id
end

#customer_idString (readonly)

Returns:

  • (String)


16355
16356
16357
# File 'lib/pago/v2026_04/models.rb', line 16355

def customer_id
  @customer_id
end

#customer_nameString? (readonly)

Returns:

  • (String, nil)


16361
16362
16363
# File 'lib/pago/v2026_04/models.rb', line 16361

def customer_name
  @customer_name
end

Class Method Details

.from_json(data) ⇒ CustomerCreatedMetadata?

Parameters:

  • data (Hash, String, nil)

Returns:



16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
# File 'lib/pago/v2026_04/models.rb', line 16381

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(
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      customer_email: (data.key?("customer_email") ? data["customer_email"] : ::Pago::UNSET),
      customer_name: (data.key?("customer_name") ? data["customer_name"] : ::Pago::UNSET),
      customer_external_id: (data.key?("customer_external_id") ? data["customer_external_id"] : ::Pago::UNSET)
    ),
    data
  )
end