Class: Pago::V2026_04::Models::CustomerIndividualCreate

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])
{
  metadata: "metadata",
  external_id: "external_id",
  name: "name",
  billing_address: "billing_address",
  tax_id: "tax_id",
  locale: "locale",
  organization_id: "organization_id",
  owner: "owner",
  type: "type",
  email: "email"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["email"].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(metadata: ::Pago::UNSET, external_id: ::Pago::UNSET, name: ::Pago::UNSET, billing_address: ::Pago::UNSET, tax_id: ::Pago::UNSET, locale: ::Pago::UNSET, organization_id: ::Pago::UNSET, owner: ::Pago::UNSET, type: ::Pago::UNSET, email:) ⇒ CustomerIndividualCreate

Returns a new instance of CustomerIndividualCreate.

Parameters:

  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • external_id: (String, nil) (defaults to: ::Pago::UNSET)
  • name: (String, nil) (defaults to: ::Pago::UNSET)
  • billing_address: (Models::AddressInput, nil) (defaults to: ::Pago::UNSET)
  • tax_id: (String, nil) (defaults to: ::Pago::UNSET)
  • locale: (String, nil) (defaults to: ::Pago::UNSET)
  • organization_id: (String, nil) (defaults to: ::Pago::UNSET)
  • owner: (Models::MemberOwnerCreate, nil) (defaults to: ::Pago::UNSET)
  • type: (String, nil) (defaults to: ::Pago::UNSET)
  • email: (String)


17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
# File 'lib/pago/v2026_04/models.rb', line 17093

def initialize(
  metadata: ::Pago::UNSET,
  external_id: ::Pago::UNSET,
  name: ::Pago::UNSET,
  billing_address: ::Pago::UNSET,
  tax_id: ::Pago::UNSET,
  locale: ::Pago::UNSET,
  organization_id: ::Pago::UNSET,
  owner: ::Pago::UNSET,
  type: ::Pago::UNSET,
  email:
)
  super()
  assign(:metadata, )
  assign(:external_id, external_id)
  assign(:name, name)
  assign(:billing_address, billing_address)
  assign(:tax_id, tax_id)
  assign(:locale, locale)
  assign(:organization_id, organization_id)
  assign(:owner, owner)
  assign(:type, type)
  assign(:email, email)
end

Instance Attribute Details

#billing_addressModels::AddressInput? (readonly)

Returns:



17070
17071
17072
# File 'lib/pago/v2026_04/models.rb', line 17070

def billing_address
  @billing_address
end

#emailString (readonly)

The email address of the customer. This must be unique within the organization.

Returns:

  • (String)


17091
17092
17093
# File 'lib/pago/v2026_04/models.rb', line 17091

def email
  @email
end

#external_idString? (readonly)

The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.

Returns:

  • (String, nil)


17064
17065
17066
# File 'lib/pago/v2026_04/models.rb', line 17064

def external_id
  @external_id
end

#localeString? (readonly)

Returns:

  • (String, nil)


17076
17077
17078
# File 'lib/pago/v2026_04/models.rb', line 17076

def locale
  @locale
end

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


17060
17061
17062
# File 'lib/pago/v2026_04/models.rb', line 17060

def 
  @metadata
end

#nameString? (readonly)

Returns:

  • (String, nil)


17067
17068
17069
# File 'lib/pago/v2026_04/models.rb', line 17067

def name
  @name
end

#organization_idString? (readonly)

The ID of the organization owning the customer. Required unless you use an organization token.

Returns:

  • (String, nil)


17080
17081
17082
# File 'lib/pago/v2026_04/models.rb', line 17080

def organization_id
  @organization_id
end

#ownerModels::MemberOwnerCreate? (readonly)

Optional owner member to create with the customer. If not provided, an owner member will be automatically created using the customer's email and name.

Returns:



17084
17085
17086
# File 'lib/pago/v2026_04/models.rb', line 17084

def owner
  @owner
end

#tax_idString? (readonly)

Returns:

  • (String, nil)


17073
17074
17075
# File 'lib/pago/v2026_04/models.rb', line 17073

def tax_id
  @tax_id
end

#typeString (readonly)

Returns:

  • (String)


17087
17088
17089
# File 'lib/pago/v2026_04/models.rb', line 17087

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerIndividualCreate?

Parameters:

  • data (Hash, String, nil)

Returns:



17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
# File 'lib/pago/v2026_04/models.rb', line 17120

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(
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      billing_address: (data.key?("billing_address") ? Models::AddressInput.from_json(data["billing_address"]) : ::Pago::UNSET),
      tax_id: (data.key?("tax_id") ? data["tax_id"] : ::Pago::UNSET),
      locale: (data.key?("locale") ? data["locale"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      owner: (data.key?("owner") ? Models::MemberOwnerCreate.from_json(data["owner"]) : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      email: (data.key?("email") ? data["email"] : ::Pago::UNSET)
    ),
    data
  )
end