Class: Dinie::Customer
- Inherits:
-
Internal::Model
- Object
- Internal::Model
- Dinie::Customer
- Defined in:
- lib/dinie/generated/types/customer.rb,
sig/dinie/generated/types/customer.rbs
Constant Summary
Constants inherited from Internal::Model
Internal::Model::REDACTED_ATTRIBUTES
Instance Attribute Summary collapse
-
#cnpj ⇒ String?
readonly
Returns the value of attribute cnpj.
-
#cpf ⇒ String
readonly
Returns the value of attribute cpf.
-
#created_at ⇒ Integer
readonly
Returns the value of attribute created_at.
-
#email ⇒ String
readonly
Returns the value of attribute email.
-
#external_id ⇒ String?
readonly
Returns the value of attribute external_id.
-
#id ⇒ customer_id
readonly
Returns the value of attribute id.
-
#kyc ⇒ Array[Kyc::Requirement]?
readonly
Returns the value of attribute kyc.
-
#name ⇒ String?
readonly
Returns the value of attribute name.
-
#phone ⇒ String
readonly
Returns the value of attribute phone.
-
#status ⇒ customer_status
readonly
Returns the value of attribute status.
-
#trading_name ⇒ String?
readonly
Returns the value of attribute trading_name.
-
#updated_at ⇒ Integer
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
- .deserialize(raw) ⇒ Customer
- .serialize_create(cnpj:, cpf:, email:, phone:, external_id: Internal::OMIT, name: Internal::OMIT) ⇒ Hash[Symbol, untyped]
- .serialize_update(email: Internal::OMIT, phone: Internal::OMIT) ⇒ Hash[Symbol, untyped]
Methods inherited from Internal::Model
#==, attribute, attributes, #deconstruct_keys, #hash, inherited, #initialize, #inspect, #to_h
Constructor Details
This class inherits a constructor from Dinie::Internal::Model
Instance Attribute Details
#cnpj ⇒ String? (readonly)
Returns the value of attribute cnpj.
6 7 8 |
# File 'sig/dinie/generated/types/customer.rbs', line 6 def cnpj @cnpj end |
#cpf ⇒ String (readonly)
Returns the value of attribute cpf.
7 8 9 |
# File 'sig/dinie/generated/types/customer.rbs', line 7 def cpf @cpf end |
#created_at ⇒ Integer (readonly)
Returns the value of attribute created_at.
8 9 10 |
# File 'sig/dinie/generated/types/customer.rbs', line 8 def created_at @created_at end |
#email ⇒ String (readonly)
Returns the value of attribute email.
9 10 11 |
# File 'sig/dinie/generated/types/customer.rbs', line 9 def email @email end |
#external_id ⇒ String? (readonly)
Returns the value of attribute external_id.
10 11 12 |
# File 'sig/dinie/generated/types/customer.rbs', line 10 def external_id @external_id end |
#id ⇒ customer_id (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'sig/dinie/generated/types/customer.rbs', line 11 def id @id end |
#kyc ⇒ Array[Kyc::Requirement]? (readonly)
Returns the value of attribute kyc.
12 13 14 |
# File 'sig/dinie/generated/types/customer.rbs', line 12 def kyc @kyc end |
#name ⇒ String? (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'sig/dinie/generated/types/customer.rbs', line 13 def name @name end |
#phone ⇒ String (readonly)
Returns the value of attribute phone.
14 15 16 |
# File 'sig/dinie/generated/types/customer.rbs', line 14 def phone @phone end |
#status ⇒ customer_status (readonly)
Returns the value of attribute status.
15 16 17 |
# File 'sig/dinie/generated/types/customer.rbs', line 15 def status @status end |
#trading_name ⇒ String? (readonly)
Returns the value of attribute trading_name.
16 17 18 |
# File 'sig/dinie/generated/types/customer.rbs', line 16 def trading_name @trading_name end |
#updated_at ⇒ Integer (readonly)
Returns the value of attribute updated_at.
17 18 19 |
# File 'sig/dinie/generated/types/customer.rbs', line 17 def updated_at @updated_at end |
Class Method Details
.deserialize(raw) ⇒ Customer
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dinie/generated/types/customer.rb', line 20 def self.deserialize(raw) new( cnpj: raw[:cnpj], cpf: raw[:cpf], created_at: raw[:created_at], email: raw[:email], external_id: raw[:external_id], id: raw[:id], kyc: raw[:kyc]&.map { |requirement| Dinie.deserialize_kyc_requirement(requirement) }, metadata: raw[:metadata], name: raw[:name], phone: raw[:phone], status: raw[:status], trading_name: raw[:trading_name], updated_at: raw[:updated_at] ) end |
.serialize_create(cnpj:, cpf:, email:, phone:, external_id: Internal::OMIT, name: Internal::OMIT) ⇒ Hash[Symbol, untyped]
38 39 40 |
# File 'lib/dinie/generated/types/customer.rb', line 38 def self.serialize_create(cnpj:, cpf:, email:, phone:, external_id: Internal::OMIT, name: Internal::OMIT) { cnpj:, cpf:, email:, external_id:, name:, phone: }.reject { |_key, value| Internal.omitted?(value) } end |
.serialize_update(email: Internal::OMIT, phone: Internal::OMIT) ⇒ Hash[Symbol, untyped]
42 43 44 |
# File 'lib/dinie/generated/types/customer.rb', line 42 def self.serialize_update(email: Internal::OMIT, phone: Internal::OMIT) { email:, phone: }.reject { |_key, value| Internal.omitted?(value) } end |