Class: Pago::V2026_04::Models::CustomerStateIndividual

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

Overview

A customer along with additional state information:

  • Active subscriptions
  • Granted benefits
  • Active meters

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  metadata: "metadata",
  external_id: "external_id",
  email: "email",
  email_verified: "email_verified",
  type: "type",
  name: "name",
  billing_name: "billing_name",
  billing_address: "billing_address",
  tax_id: "tax_id",
  locale: "locale",
  organization_id: "organization_id",
  default_payment_method_id: "default_payment_method_id",
  deleted_at: "deleted_at",
  avatar_url: "avatar_url",
  active_subscriptions: "active_subscriptions",
  granted_benefits: "granted_benefits",
  active_meters: "active_meters"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "metadata", "email", "email_verified", "type", "name", "billing_name", "billing_address", "tax_id", "organization_id", "deleted_at", "avatar_url", "active_subscriptions", "granted_benefits", "active_meters"].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:, metadata:, external_id: ::Pago::UNSET, email:, email_verified:, type:, name:, billing_name:, billing_address:, tax_id:, locale: ::Pago::UNSET, organization_id:, default_payment_method_id: ::Pago::UNSET, deleted_at:, avatar_url:, active_subscriptions:, granted_benefits:, active_meters:) ⇒ CustomerStateIndividual

Returns a new instance of CustomerStateIndividual.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • metadata: (Hash[String, untyped])
  • external_id: (String, nil) (defaults to: ::Pago::UNSET)
  • email: (String)
  • email_verified: (Boolean)
  • type: (String)
  • name: (String, nil)
  • billing_name: (String, nil)
  • billing_address: (Models::Address, nil)
  • tax_id: (Array[untyped], nil)
  • locale: (String, nil) (defaults to: ::Pago::UNSET)
  • organization_id: (String)
  • default_payment_method_id: (String, nil) (defaults to: ::Pago::UNSET)
  • deleted_at: (String, nil)
  • avatar_url: (String, nil)
  • active_subscriptions: (Array[Models::CustomerStateSubscription])
  • granted_benefits: (Array[Models::CustomerStateBenefitGrant])
  • active_meters: (Array[Models::CustomerStateMeter])


20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
# File 'lib/pago/v2026_04/models.rb', line 20112

def initialize(
  id:,
  created_at:,
  modified_at:,
  metadata:,
  external_id: ::Pago::UNSET,
  email:,
  email_verified:,
  type:,
  name:,
  billing_name:,
  billing_address:,
  tax_id:,
  locale: ::Pago::UNSET,
  organization_id:,
  default_payment_method_id: ::Pago::UNSET,
  deleted_at:,
  avatar_url:,
  active_subscriptions:,
  granted_benefits:,
  active_meters:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:metadata, )
  assign(:external_id, external_id)
  assign(:email, email)
  assign(:email_verified, email_verified)
  assign(:type, type)
  assign(:name, name)
  assign(:billing_name, billing_name)
  assign(:billing_address, billing_address)
  assign(:tax_id, tax_id)
  assign(:locale, locale)
  assign(:organization_id, organization_id)
  assign(:default_payment_method_id, default_payment_method_id)
  assign(:deleted_at, deleted_at)
  assign(:avatar_url, avatar_url)
  assign(:active_subscriptions, active_subscriptions)
  assign(:granted_benefits, granted_benefits)
  assign(:active_meters, active_meters)
end

Instance Attribute Details

#active_metersArray<Models::CustomerStateMeter> (readonly)

The customer's active meters.

Returns:



20110
20111
20112
# File 'lib/pago/v2026_04/models.rb', line 20110

def active_meters
  @active_meters
end

#active_subscriptionsArray<Models::CustomerStateSubscription> (readonly)

The customer's active subscriptions.



20102
20103
20104
# File 'lib/pago/v2026_04/models.rb', line 20102

def active_subscriptions
  @active_subscriptions
end

#avatar_urlString? (readonly)

Returns:

  • (String, nil)


20098
20099
20100
# File 'lib/pago/v2026_04/models.rb', line 20098

def avatar_url
  @avatar_url
end

#billing_addressModels::Address? (readonly)

Returns:



20077
20078
20079
# File 'lib/pago/v2026_04/models.rb', line 20077

def billing_address
  @billing_address
end

#billing_nameString? (readonly)

The name that should appear on the customer's invoices. Falls back to the customer name when not explicitly set.

Returns:

  • (String, nil)


20074
20075
20076
# File 'lib/pago/v2026_04/models.rb', line 20074

def billing_name
  @billing_name
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


20043
20044
20045
# File 'lib/pago/v2026_04/models.rb', line 20043

def created_at
  @created_at
end

#default_payment_method_idString? (readonly)

The ID of the customer's default payment method, if any. Use the payment methods endpoint to retrieve its details.

Returns:

  • (String, nil)


20091
20092
20093
# File 'lib/pago/v2026_04/models.rb', line 20091

def default_payment_method_id
  @default_payment_method_id
end

#deleted_atString? (readonly)

Timestamp for when the customer was soft deleted.

Returns:

  • (String, nil)


20095
20096
20097
# File 'lib/pago/v2026_04/models.rb', line 20095

def deleted_at
  @deleted_at
end

#emailString (readonly)

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

Returns:

  • (String)


20058
20059
20060
# File 'lib/pago/v2026_04/models.rb', line 20058

def email
  @email
end

#email_verifiedBoolean (readonly)

Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.

Returns:

  • (Boolean)


20062
20063
20064
# File 'lib/pago/v2026_04/models.rb', line 20062

def email_verified
  @email_verified
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)


20054
20055
20056
# File 'lib/pago/v2026_04/models.rb', line 20054

def external_id
  @external_id
end

#granted_benefitsArray<Models::CustomerStateBenefitGrant> (readonly)

The customer's active benefit grants.



20106
20107
20108
# File 'lib/pago/v2026_04/models.rb', line 20106

def granted_benefits
  @granted_benefits
end

#idString (readonly)

The ID of the customer.

Returns:

  • (String)


20039
20040
20041
# File 'lib/pago/v2026_04/models.rb', line 20039

def id
  @id
end

#localeString? (readonly)

Returns:

  • (String, nil)


20083
20084
20085
# File 'lib/pago/v2026_04/models.rb', line 20083

def locale
  @locale
end

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

Returns:

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


20050
20051
20052
# File 'lib/pago/v2026_04/models.rb', line 20050

def 
  @metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


20047
20048
20049
# File 'lib/pago/v2026_04/models.rb', line 20047

def modified_at
  @modified_at
end

#nameString? (readonly)

The name of the customer.

Returns:

  • (String, nil)


20070
20071
20072
# File 'lib/pago/v2026_04/models.rb', line 20070

def name
  @name
end

#organization_idString (readonly)

The ID of the organization owning the customer.

Returns:

  • (String)


20087
20088
20089
# File 'lib/pago/v2026_04/models.rb', line 20087

def organization_id
  @organization_id
end

#tax_idArray<Object>? (readonly)

Returns:

  • (Array<Object>, nil)


20080
20081
20082
# File 'lib/pago/v2026_04/models.rb', line 20080

def tax_id
  @tax_id
end

#typeString (readonly)

The type of customer.

Returns:

  • (String)


20066
20067
20068
# File 'lib/pago/v2026_04/models.rb', line 20066

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerStateIndividual?

Parameters:

  • data (Hash, String, nil)

Returns:



20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
# File 'lib/pago/v2026_04/models.rb', line 20159

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),
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      email: (data.key?("email") ? data["email"] : ::Pago::UNSET),
      email_verified: (data.key?("email_verified") ? data["email_verified"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      billing_name: (data.key?("billing_name") ? data["billing_name"] : ::Pago::UNSET),
      billing_address: (data.key?("billing_address") ? Models::Address.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),
      default_payment_method_id: (data.key?("default_payment_method_id") ? data["default_payment_method_id"] : ::Pago::UNSET),
      deleted_at: (data.key?("deleted_at") ? data["deleted_at"] : ::Pago::UNSET),
      avatar_url: (data.key?("avatar_url") ? data["avatar_url"] : ::Pago::UNSET),
      active_subscriptions: (data.key?("active_subscriptions") ? ::Pago::Serde.array(data["active_subscriptions"]) { |item0| Models::CustomerStateSubscription.from_json(item0) } : ::Pago::UNSET),
      granted_benefits: (data.key?("granted_benefits") ? ::Pago::Serde.array(data["granted_benefits"]) { |item0| Models::CustomerStateBenefitGrant.from_json(item0) } : ::Pago::UNSET),
      active_meters: (data.key?("active_meters") ? ::Pago::Serde.array(data["active_meters"]) { |item0| Models::CustomerStateMeter.from_json(item0) } : ::Pago::UNSET)
    ),
    data
  )
end