Class: Pago::V2026_04::Models::CustomerStateIndividual
- 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 =
{ 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 =
["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
-
#active_meters ⇒ Array<Models::CustomerStateMeter>
readonly
The customer's active meters.
-
#active_subscriptions ⇒ Array<Models::CustomerStateSubscription>
readonly
The customer's active subscriptions.
- #avatar_url ⇒ String? readonly
- #billing_address ⇒ Models::Address? readonly
-
#billing_name ⇒ String?
readonly
The name that should appear on the customer's invoices.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#default_payment_method_id ⇒ String?
readonly
The ID of the customer's default payment method, if any.
-
#deleted_at ⇒ String?
readonly
Timestamp for when the customer was soft deleted.
-
#email ⇒ String
readonly
The email address of the customer.
-
#email_verified ⇒ Boolean
readonly
Whether the customer email address is verified.
-
#external_id ⇒ String?
readonly
The ID of the customer in your system.
-
#granted_benefits ⇒ Array<Models::CustomerStateBenefitGrant>
readonly
The customer's active benefit grants.
-
#id ⇒ String
readonly
The ID of the customer.
- #locale ⇒ String? readonly
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#name ⇒ String?
readonly
The name of the customer.
-
#organization_id ⇒ String
readonly
The ID of the organization owning the customer.
- #tax_id ⇒ Array<Object>? readonly
-
#type ⇒ String
readonly
The type of customer.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of CustomerStateIndividual.
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.
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_meters ⇒ Array<Models::CustomerStateMeter> (readonly)
The customer's active meters.
20110 20111 20112 |
# File 'lib/pago/v2026_04/models.rb', line 20110 def active_meters @active_meters end |
#active_subscriptions ⇒ Array<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_url ⇒ String? (readonly)
20098 20099 20100 |
# File 'lib/pago/v2026_04/models.rb', line 20098 def avatar_url @avatar_url end |
#billing_address ⇒ Models::Address? (readonly)
20077 20078 20079 |
# File 'lib/pago/v2026_04/models.rb', line 20077 def billing_address @billing_address end |
#billing_name ⇒ String? (readonly)
The name that should appear on the customer's invoices. Falls back to the customer name when not explicitly set.
20074 20075 20076 |
# File 'lib/pago/v2026_04/models.rb', line 20074 def billing_name @billing_name end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
20043 20044 20045 |
# File 'lib/pago/v2026_04/models.rb', line 20043 def created_at @created_at end |
#default_payment_method_id ⇒ String? (readonly)
The ID of the customer's default payment method, if any. Use the payment methods endpoint to retrieve its details.
20091 20092 20093 |
# File 'lib/pago/v2026_04/models.rb', line 20091 def default_payment_method_id @default_payment_method_id end |
#deleted_at ⇒ String? (readonly)
Timestamp for when the customer was soft deleted.
20095 20096 20097 |
# File 'lib/pago/v2026_04/models.rb', line 20095 def deleted_at @deleted_at end |
#email ⇒ String (readonly)
The email address of the customer. This must be unique within the organization.
20058 20059 20060 |
# File 'lib/pago/v2026_04/models.rb', line 20058 def email @email end |
#email_verified ⇒ Boolean (readonly)
Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.
20062 20063 20064 |
# File 'lib/pago/v2026_04/models.rb', line 20062 def email_verified @email_verified end |
#external_id ⇒ String? (readonly)
The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.
20054 20055 20056 |
# File 'lib/pago/v2026_04/models.rb', line 20054 def external_id @external_id end |
#granted_benefits ⇒ Array<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 |
#id ⇒ String (readonly)
The ID of the customer.
20039 20040 20041 |
# File 'lib/pago/v2026_04/models.rb', line 20039 def id @id end |
#locale ⇒ String? (readonly)
20083 20084 20085 |
# File 'lib/pago/v2026_04/models.rb', line 20083 def locale @locale end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
20050 20051 20052 |
# File 'lib/pago/v2026_04/models.rb', line 20050 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
20047 20048 20049 |
# File 'lib/pago/v2026_04/models.rb', line 20047 def modified_at @modified_at end |
#name ⇒ String? (readonly)
The name of the customer.
20070 20071 20072 |
# File 'lib/pago/v2026_04/models.rb', line 20070 def name @name end |
#organization_id ⇒ String (readonly)
The ID of the organization owning the customer.
20087 20088 20089 |
# File 'lib/pago/v2026_04/models.rb', line 20087 def organization_id @organization_id end |
#tax_id ⇒ Array<Object>? (readonly)
20080 20081 20082 |
# File 'lib/pago/v2026_04/models.rb', line 20080 def tax_id @tax_id end |
#type ⇒ String (readonly)
The type of customer.
20066 20067 20068 |
# File 'lib/pago/v2026_04/models.rb', line 20066 def type @type end |
Class Method Details
.from_json(data) ⇒ CustomerStateIndividual?
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 |