Class: Pago::V2026_04::Models::CustomerUpdate

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",
  email: "email",
  name: "name",
  billing_address: "billing_address",
  tax_id: "tax_id",
  locale: "locale",
  external_id: "external_id",
  type: "type"
}.freeze
REQUIRED_KEYS =

Returns:

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

Returns a new instance of CustomerUpdate.

Parameters:

  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • email: (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)
  • external_id: (String, nil) (defaults to: ::Pago::UNSET)
  • type: (String, nil) (defaults to: ::Pago::UNSET)


21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
# File 'lib/pago/v2026_04/models.rb', line 21889

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

Instance Attribute Details

#billing_addressModels::AddressInput? (readonly)

Returns:



21873
21874
21875
# File 'lib/pago/v2026_04/models.rb', line 21873

def billing_address
  @billing_address
end

#emailString? (readonly)

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

Returns:

  • (String, nil)


21867
21868
21869
# File 'lib/pago/v2026_04/models.rb', line 21867

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)


21883
21884
21885
# File 'lib/pago/v2026_04/models.rb', line 21883

def external_id
  @external_id
end

#localeString? (readonly)

Returns:

  • (String, nil)


21879
21880
21881
# File 'lib/pago/v2026_04/models.rb', line 21879

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


21863
21864
21865
# File 'lib/pago/v2026_04/models.rb', line 21863

def 
  @metadata
end

#nameString? (readonly)

Returns:

  • (String, nil)


21870
21871
21872
# File 'lib/pago/v2026_04/models.rb', line 21870

def name
  @name
end

#tax_idString? (readonly)

Returns:

  • (String, nil)


21876
21877
21878
# File 'lib/pago/v2026_04/models.rb', line 21876

def tax_id
  @tax_id
end

#typeString? (readonly)

The customer type. Can only be upgraded from 'individual' to 'team', never downgraded.

Returns:

  • (String, nil)


21887
21888
21889
# File 'lib/pago/v2026_04/models.rb', line 21887

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
# File 'lib/pago/v2026_04/models.rb', line 21912

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),
      email: (data.key?("email") ? data["email"] : ::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),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET)
    ),
    data
  )
end