Class: ApiReference::Customer
- Defined in:
- lib/api_reference/models/customer.rb
Overview
A customer is a buyer of your products, and the other party to the billing
relationship. In Orb, customers are assigned system generated identifiers
automatically, but it's often desirable to have these match existing
identifiers in your system. To avoid having to denormalize Orb ID
information, you can pass in an external_customer_id with your own
identifier. See Customer ID Aliases
for further information about how these aliases work in Orb. In addition to
having an identifier in your system, a customer may exist in a payment
provider solution like Stripe. Use the payment_provider_id and the
payment_provider enum field to express this mapping. A customer also has a
timezone (from the standard IANA timezone
database), which defaults to your
account's timezone. See Timezone localization for
information on what this timezone parameter influences within Orb.
Instance Attribute Summary collapse
-
#accounting_sync_configuration ⇒ AccountingSyncConfiguration
Deprecated.
-
#additional_emails ⇒ Array[String]
Whether invoices for this customer should be automatically issued.
-
#auto_collection ⇒ TrueClass | FalseClass
The customer's current balance in their currency.
-
#auto_issuance ⇒ TrueClass | FalseClass
Whether invoices for this customer should be automatically issued.
-
#automatic_tax_enabled ⇒ TrueClass | FalseClass
Whether automatic tax calculation is enabled for this customer.
-
#balance ⇒ String
The customer's current balance in their currency.
-
#billing_address ⇒ Address
This is used for creating charges or invoices in an external system via Orb.
-
#created_at ⇒ DateTime
This is used for creating charges or invoices in an external system via Orb.
-
#currency ⇒ String
The customer's current balance in their currency.
-
#default_payment_method ⇒ PaymentMethod
The customer's default payment method, or null if none is set.
-
#email ⇒ String
A valid customer email, to be used for notifications.
-
#email_delivery ⇒ TrueClass | FalseClass
The customer's current balance in their currency.
-
#exempt_from_automated_tax ⇒ TrueClass | FalseClass
The customer's current balance in their currency.
-
#external_customer_id ⇒ String
An optional user-defined ID for this customer resource, used throughout the system as an alias for this Customer.
-
#hierarchy ⇒ CustomerHierarchy2
The hierarchical relationships for this customer.
-
#id ⇒ String
User specified key-value pairs for the resource.
-
#metadata ⇒ Hash[String, String]
User specified key-value pairs for the resource.
-
#name ⇒ String
The full name of the customer.
-
#payment_configuration ⇒ PaymentConfiguration
Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe.
-
#payment_provider ⇒ PaymentProvider1
This is used for creating charges or invoices in an external system via Orb.
-
#payment_provider_id ⇒ String
The ID of this customer in an external payments solution, such as Stripe.
-
#portal_url ⇒ String
Deprecated.
-
#reporting_configuration ⇒ ReportingConfiguration
Deprecated.
-
#shipping_address ⇒ Address
This is used for creating charges or invoices in an external system via Orb.
-
#tax_id ⇒ CustomerTaxId
The customer's current balance in their currency.
-
#timezone ⇒ String
A timezone identifier from the IANA timezone database, such as "America/Los_Angeles".
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(metadata:, id:, external_customer_id:, name:, email:, timezone:, payment_provider_id:, payment_provider:, created_at:, shipping_address:, billing_address:, balance:, currency:, tax_id:, auto_collection:, exempt_from_automated_tax:, email_delivery:, auto_issuance:, additional_emails:, portal_url:, hierarchy:, accounting_sync_configuration: SKIP, reporting_configuration: SKIP, payment_configuration: SKIP, default_payment_method: SKIP, automatic_tax_enabled: SKIP, additional_properties: nil) ⇒ Customer
constructor
A new instance of Customer.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(metadata:, id:, external_customer_id:, name:, email:, timezone:, payment_provider_id:, payment_provider:, created_at:, shipping_address:, billing_address:, balance:, currency:, tax_id:, auto_collection:, exempt_from_automated_tax:, email_delivery:, auto_issuance:, additional_emails:, portal_url:, hierarchy:, accounting_sync_configuration: SKIP, reporting_configuration: SKIP, payment_configuration: SKIP, default_payment_method: SKIP, automatic_tax_enabled: SKIP, additional_properties: nil) ⇒ Customer
Returns a new instance of Customer.
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/api_reference/models/customer.rb', line 233 def initialize(metadata:, id:, external_customer_id:, name:, email:, timezone:, payment_provider_id:, payment_provider:, created_at:, shipping_address:, billing_address:, balance:, currency:, tax_id:, auto_collection:, exempt_from_automated_tax:, email_delivery:, auto_issuance:, additional_emails:, portal_url:, hierarchy:, accounting_sync_configuration: SKIP, reporting_configuration: SKIP, payment_configuration: SKIP, default_payment_method: SKIP, automatic_tax_enabled: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @metadata = @id = id @external_customer_id = external_customer_id @name = name @email = email @timezone = timezone @payment_provider_id = payment_provider_id @payment_provider = payment_provider @created_at = created_at @shipping_address = shipping_address @billing_address = billing_address @balance = balance @currency = currency @tax_id = tax_id @auto_collection = auto_collection @exempt_from_automated_tax = exempt_from_automated_tax @email_delivery = email_delivery @auto_issuance = auto_issuance @additional_emails = additional_emails @portal_url = portal_url unless accounting_sync_configuration == SKIP @accounting_sync_configuration = accounting_sync_configuration end @reporting_configuration = reporting_configuration unless reporting_configuration == SKIP @payment_configuration = payment_configuration unless payment_configuration == SKIP @default_payment_method = default_payment_method unless default_payment_method == SKIP @hierarchy = hierarchy @automatic_tax_enabled = automatic_tax_enabled unless automatic_tax_enabled == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#accounting_sync_configuration ⇒ AccountingSyncConfiguration
Deprecated. Returns the URL of the most recent non-expired portal link, or null. When the account has opted into customer portal sessions, this field always returns null. Use POST /v1/customers/#id/portal_sessions to mint short-lived portal session URLs.
140 141 142 |
# File 'lib/api_reference/models/customer.rb', line 140 def accounting_sync_configuration @accounting_sync_configuration end |
#additional_emails ⇒ Array[String]
Whether invoices for this customer should be automatically issued. If true, invoices will be automatically issued. If false, invoices will require manual approval. If null, inherits the account-level setting.
126 127 128 |
# File 'lib/api_reference/models/customer.rb', line 126 def additional_emails @additional_emails end |
#auto_collection ⇒ TrueClass | FalseClass
The customer's current balance in their currency.
106 107 108 |
# File 'lib/api_reference/models/customer.rb', line 106 def auto_collection @auto_collection end |
#auto_issuance ⇒ TrueClass | FalseClass
Whether invoices for this customer should be automatically issued. If true, invoices will be automatically issued. If false, invoices will require manual approval. If null, inherits the account-level setting.
120 121 122 |
# File 'lib/api_reference/models/customer.rb', line 120 def auto_issuance @auto_issuance end |
#automatic_tax_enabled ⇒ TrueClass | FalseClass
Whether automatic tax calculation is enabled for this customer. This field is nullable for backwards compatibility but will always return a boolean value.
166 167 168 |
# File 'lib/api_reference/models/customer.rb', line 166 def automatic_tax_enabled @automatic_tax_enabled end |
#balance ⇒ String
The customer's current balance in their currency.
94 95 96 |
# File 'lib/api_reference/models/customer.rb', line 94 def balance @balance end |
#billing_address ⇒ Address
This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp.
90 91 92 |
# File 'lib/api_reference/models/customer.rb', line 90 def billing_address @billing_address end |
#created_at ⇒ DateTime
This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp.
78 79 80 |
# File 'lib/api_reference/models/customer.rb', line 78 def created_at @created_at end |
#currency ⇒ String
The customer's current balance in their currency.
98 99 100 |
# File 'lib/api_reference/models/customer.rb', line 98 def currency @currency end |
#default_payment_method ⇒ PaymentMethod
The customer's default payment method, or null if none is set.
156 157 158 |
# File 'lib/api_reference/models/customer.rb', line 156 def default_payment_method @default_payment_method end |
#email ⇒ String
A valid customer email, to be used for notifications. When Orb triggers payment through a payment gateway, this email will be used for any automatically issued receipts.
54 55 56 |
# File 'lib/api_reference/models/customer.rb', line 54 def email @email end |
#email_delivery ⇒ TrueClass | FalseClass
The customer's current balance in their currency.
114 115 116 |
# File 'lib/api_reference/models/customer.rb', line 114 def email_delivery @email_delivery end |
#exempt_from_automated_tax ⇒ TrueClass | FalseClass
The customer's current balance in their currency.
110 111 112 |
# File 'lib/api_reference/models/customer.rb', line 110 def exempt_from_automated_tax @exempt_from_automated_tax end |
#external_customer_id ⇒ String
An optional user-defined ID for this customer resource, used throughout the system as an alias for this Customer. Use this field to identify a customer by an existing identifier in your system.
44 45 46 |
# File 'lib/api_reference/models/customer.rb', line 44 def external_customer_id @external_customer_id end |
#hierarchy ⇒ CustomerHierarchy2
The hierarchical relationships for this customer.
160 161 162 |
# File 'lib/api_reference/models/customer.rb', line 160 def hierarchy @hierarchy end |
#id ⇒ String
User specified key-value pairs for the resource. If not present, this
defaults to an empty dictionary. Individual keys can be removed by setting
the value to null, and the entire metadata mapping can be cleared by
setting metadata to null.
38 39 40 |
# File 'lib/api_reference/models/customer.rb', line 38 def id @id end |
#metadata ⇒ Hash[String, String]
User specified key-value pairs for the resource. If not present, this
defaults to an empty dictionary. Individual keys can be removed by setting
the value to null, and the entire metadata mapping can be cleared by
setting metadata to null.
31 32 33 |
# File 'lib/api_reference/models/customer.rb', line 31 def @metadata end |
#name ⇒ String
The full name of the customer
48 49 50 |
# File 'lib/api_reference/models/customer.rb', line 48 def name @name end |
#payment_configuration ⇒ PaymentConfiguration
Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe.
152 153 154 |
# File 'lib/api_reference/models/customer.rb', line 152 def payment_configuration @payment_configuration end |
#payment_provider ⇒ PaymentProvider1
This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp.
72 73 74 |
# File 'lib/api_reference/models/customer.rb', line 72 def payment_provider @payment_provider end |
#payment_provider_id ⇒ String
The ID of this customer in an external payments solution, such as Stripe. This is used for creating charges or invoices in the external system via Orb.
66 67 68 |
# File 'lib/api_reference/models/customer.rb', line 66 def payment_provider_id @payment_provider_id end |
#portal_url ⇒ String
Deprecated. Returns the URL of the most recent non-expired portal link, or null. When the account has opted into customer portal sessions, this field always returns null. Use POST /v1/customers/#id/portal_sessions to mint short-lived portal session URLs.
133 134 135 |
# File 'lib/api_reference/models/customer.rb', line 133 def portal_url @portal_url end |
#reporting_configuration ⇒ ReportingConfiguration
Deprecated. Returns the URL of the most recent non-expired portal link, or null. When the account has opted into customer portal sessions, this field always returns null. Use POST /v1/customers/#id/portal_sessions to mint short-lived portal session URLs.
147 148 149 |
# File 'lib/api_reference/models/customer.rb', line 147 def reporting_configuration @reporting_configuration end |
#shipping_address ⇒ Address
This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp.
84 85 86 |
# File 'lib/api_reference/models/customer.rb', line 84 def shipping_address @shipping_address end |
#tax_id ⇒ CustomerTaxId
The customer's current balance in their currency.
102 103 104 |
# File 'lib/api_reference/models/customer.rb', line 102 def tax_id @tax_id end |
#timezone ⇒ String
A timezone identifier from the IANA timezone database, such as "America/Los_Angeles". This "defaults to your account's timezone if not set. This cannot be changed after customer creation.
60 61 62 |
# File 'lib/api_reference/models/customer.rb', line 60 def timezone @timezone end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/api_reference/models/customer.rb', line 279 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash.key?('metadata') ? hash['metadata'] : nil id = hash.key?('id') ? hash['id'] : nil external_customer_id = hash.key?('external_customer_id') ? hash['external_customer_id'] : nil name = hash.key?('name') ? hash['name'] : nil email = hash.key?('email') ? hash['email'] : nil timezone = hash.key?('timezone') ? hash['timezone'] : nil payment_provider_id = hash.key?('payment_provider_id') ? hash['payment_provider_id'] : nil payment_provider = hash.key?('payment_provider') ? hash['payment_provider'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end shipping_address = Address.from_hash(hash['shipping_address']) if hash['shipping_address'] billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address'] balance = hash.key?('balance') ? hash['balance'] : nil currency = hash.key?('currency') ? hash['currency'] : nil tax_id = CustomerTaxId.from_hash(hash['tax_id']) if hash['tax_id'] auto_collection = hash.key?('auto_collection') ? hash['auto_collection'] : nil exempt_from_automated_tax = hash.key?('exempt_from_automated_tax') ? hash['exempt_from_automated_tax'] : nil email_delivery = hash.key?('email_delivery') ? hash['email_delivery'] : nil auto_issuance = hash.key?('auto_issuance') ? hash['auto_issuance'] : nil additional_emails = hash.key?('additional_emails') ? hash['additional_emails'] : nil portal_url = hash.key?('portal_url') ? hash['portal_url'] : nil hierarchy = CustomerHierarchy2.from_hash(hash['hierarchy']) if hash['hierarchy'] if hash['accounting_sync_configuration'] accounting_sync_configuration = AccountingSyncConfiguration.from_hash(hash['accounting_sync_configuration']) end reporting_configuration = ReportingConfiguration.from_hash(hash['reporting_configuration']) if hash['reporting_configuration'] payment_configuration = PaymentConfiguration.from_hash(hash['payment_configuration']) if hash['payment_configuration'] default_payment_method = PaymentMethod.from_hash(hash['default_payment_method']) if hash['default_payment_method'] automatic_tax_enabled = hash.key?('automatic_tax_enabled') ? hash['automatic_tax_enabled'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Customer.new(metadata: , id: id, external_customer_id: external_customer_id, name: name, email: email, timezone: timezone, payment_provider_id: payment_provider_id, payment_provider: payment_provider, created_at: created_at, shipping_address: shipping_address, billing_address: billing_address, balance: balance, currency: currency, tax_id: tax_id, auto_collection: auto_collection, exempt_from_automated_tax: exempt_from_automated_tax, email_delivery: email_delivery, auto_issuance: auto_issuance, additional_emails: additional_emails, portal_url: portal_url, hierarchy: hierarchy, accounting_sync_configuration: accounting_sync_configuration, reporting_configuration: reporting_configuration, payment_configuration: payment_configuration, default_payment_method: default_payment_method, automatic_tax_enabled: automatic_tax_enabled, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/api_reference/models/customer.rb', line 169 def self.names @_hash = {} if @_hash.nil? @_hash['metadata'] = 'metadata' @_hash['id'] = 'id' @_hash['external_customer_id'] = 'external_customer_id' @_hash['name'] = 'name' @_hash['email'] = 'email' @_hash['timezone'] = 'timezone' @_hash['payment_provider_id'] = 'payment_provider_id' @_hash['payment_provider'] = 'payment_provider' @_hash['created_at'] = 'created_at' @_hash['shipping_address'] = 'shipping_address' @_hash['billing_address'] = 'billing_address' @_hash['balance'] = 'balance' @_hash['currency'] = 'currency' @_hash['tax_id'] = 'tax_id' @_hash['auto_collection'] = 'auto_collection' @_hash['exempt_from_automated_tax'] = 'exempt_from_automated_tax' @_hash['email_delivery'] = 'email_delivery' @_hash['auto_issuance'] = 'auto_issuance' @_hash['additional_emails'] = 'additional_emails' @_hash['portal_url'] = 'portal_url' @_hash['accounting_sync_configuration'] = 'accounting_sync_configuration' @_hash['reporting_configuration'] = 'reporting_configuration' @_hash['payment_configuration'] = 'payment_configuration' @_hash['default_payment_method'] = 'default_payment_method' @_hash['hierarchy'] = 'hierarchy' @_hash['automatic_tax_enabled'] = 'automatic_tax_enabled' @_hash end |
.nullables ⇒ Object
An array for nullable fields
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/api_reference/models/customer.rb', line 213 def self.nullables %w[ external_customer_id payment_provider_id payment_provider shipping_address billing_address currency tax_id exempt_from_automated_tax auto_issuance portal_url accounting_sync_configuration reporting_configuration payment_configuration default_payment_method automatic_tax_enabled ] end |
.optionals ⇒ Object
An array for optional fields
202 203 204 205 206 207 208 209 210 |
# File 'lib/api_reference/models/customer.rb', line 202 def self.optionals %w[ accounting_sync_configuration reporting_configuration payment_configuration default_payment_method automatic_tax_enabled ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
# File 'lib/api_reference/models/customer.rb', line 368 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value., ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.external_customer_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.email, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.timezone, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.payment_provider_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.payment_provider, ->(val) { PaymentProvider1.validate(val) }) and APIHelper.valid_type?(value.created_at, ->(val) { val.instance_of? DateTime }) and APIHelper.valid_type?(value.shipping_address, ->(val) { Address.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value.billing_address, ->(val) { Address.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value.balance, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.currency, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.tax_id, ->(val) { CustomerTaxId.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value.auto_collection, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value.exempt_from_automated_tax, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value.email_delivery, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value.auto_issuance, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value.additional_emails, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.portal_url, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.hierarchy, ->(val) { CustomerHierarchy2.validate(val) }, is_model_hash: true) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['metadata'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['external_customer_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['email'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['timezone'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['payment_provider_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['payment_provider'], ->(val) { PaymentProvider1.validate(val) }) and APIHelper.valid_type?(value['created_at'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['shipping_address'], ->(val) { Address.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value['billing_address'], ->(val) { Address.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value['balance'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['currency'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['tax_id'], ->(val) { CustomerTaxId.validate(val) }, is_model_hash: true) and APIHelper.valid_type?(value['auto_collection'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value['exempt_from_automated_tax'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value['email_delivery'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value['auto_issuance'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value['additional_emails'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['portal_url'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['hierarchy'], ->(val) { CustomerHierarchy2.validate(val) }, is_model_hash: true) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
# File 'lib/api_reference/models/customer.rb', line 491 def inspect class_name = self.class.name.split('::').last "<#{class_name} metadata: #{@metadata.inspect}, id: #{@id.inspect}, external_customer_id:"\ " #{@external_customer_id.inspect}, name: #{@name.inspect}, email: #{@email.inspect},"\ " timezone: #{@timezone.inspect}, payment_provider_id: #{@payment_provider_id.inspect},"\ " payment_provider: #{@payment_provider.inspect}, created_at: #{@created_at.inspect},"\ " shipping_address: #{@shipping_address.inspect}, billing_address:"\ " #{@billing_address.inspect}, balance: #{@balance.inspect}, currency: #{@currency.inspect},"\ " tax_id: #{@tax_id.inspect}, auto_collection: #{@auto_collection.inspect},"\ " exempt_from_automated_tax: #{@exempt_from_automated_tax.inspect}, email_delivery:"\ " #{@email_delivery.inspect}, auto_issuance: #{@auto_issuance.inspect}, additional_emails:"\ " #{@additional_emails.inspect}, portal_url: #{@portal_url.inspect},"\ " accounting_sync_configuration: #{@accounting_sync_configuration.inspect},"\ " reporting_configuration: #{@reporting_configuration.inspect}, payment_configuration:"\ " #{@payment_configuration.inspect}, default_payment_method:"\ " #{@default_payment_method.inspect}, hierarchy: #{@hierarchy.inspect},"\ " automatic_tax_enabled: #{@automatic_tax_enabled.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_created_at ⇒ Object
362 363 364 |
# File 'lib/api_reference/models/customer.rb', line 362 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/api_reference/models/customer.rb', line 473 def to_s class_name = self.class.name.split('::').last "<#{class_name} metadata: #{@metadata}, id: #{@id}, external_customer_id:"\ " #{@external_customer_id}, name: #{@name}, email: #{@email}, timezone: #{@timezone},"\ " payment_provider_id: #{@payment_provider_id}, payment_provider: #{@payment_provider},"\ " created_at: #{@created_at}, shipping_address: #{@shipping_address}, billing_address:"\ " #{@billing_address}, balance: #{@balance}, currency: #{@currency}, tax_id: #{@tax_id},"\ " auto_collection: #{@auto_collection}, exempt_from_automated_tax:"\ " #{@exempt_from_automated_tax}, email_delivery: #{@email_delivery}, auto_issuance:"\ " #{@auto_issuance}, additional_emails: #{@additional_emails}, portal_url: #{@portal_url},"\ " accounting_sync_configuration: #{@accounting_sync_configuration}, reporting_configuration:"\ " #{@reporting_configuration}, payment_configuration: #{@payment_configuration},"\ " default_payment_method: #{@default_payment_method}, hierarchy: #{@hierarchy},"\ " automatic_tax_enabled: #{@automatic_tax_enabled}, additional_properties:"\ " #{@additional_properties}>" end |