Class: Paid::Contact
- Inherits:
-
Object
- Object
- Paid::Contact
- Defined in:
- lib/paid_ruby/types/contact.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #billing_city ⇒ String readonly
- #billing_country ⇒ String readonly
- #billing_postal_code ⇒ String readonly
- #billing_state_province ⇒ String readonly
- #billing_street ⇒ String readonly
- #customer_external_id ⇒ String readonly
- #customer_id ⇒ String readonly
- #email ⇒ String readonly
- #external_id ⇒ String readonly
- #first_name ⇒ String readonly
- #id ⇒ String readonly
- #last_name ⇒ String readonly
- #organization_id ⇒ String readonly
- #phone ⇒ String readonly
- #salutation ⇒ Paid::Salutation readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id: OMIT, external_id: OMIT, organization_id: OMIT, customer_id: OMIT, customer_external_id: OMIT, salutation: OMIT, first_name: OMIT, last_name: OMIT, email: OMIT, phone: OMIT, billing_street: OMIT, billing_city: OMIT, billing_state_province: OMIT, billing_country: OMIT, billing_postal_code: OMIT, additional_properties: nil) ⇒ Paid::Contact constructor
- #to_json ⇒ String
Constructor Details
#initialize(id: OMIT, external_id: OMIT, organization_id: OMIT, customer_id: OMIT, customer_external_id: OMIT, salutation: OMIT, first_name: OMIT, last_name: OMIT, email: OMIT, phone: OMIT, billing_street: OMIT, billing_city: OMIT, billing_state_province: OMIT, billing_country: OMIT, billing_postal_code: OMIT, additional_properties: nil) ⇒ Paid::Contact
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/paid_ruby/types/contact.rb', line 63 def initialize(id: OMIT, external_id: OMIT, organization_id: OMIT, customer_id: OMIT, customer_external_id: OMIT, salutation: OMIT, first_name: OMIT, last_name: OMIT, email: OMIT, phone: OMIT, billing_street: OMIT, billing_city: OMIT, billing_state_province: OMIT, billing_country: OMIT, billing_postal_code: OMIT, additional_properties: nil) @id = id if id != OMIT @external_id = external_id if external_id != OMIT @organization_id = organization_id if organization_id != OMIT @customer_id = customer_id if customer_id != OMIT @customer_external_id = customer_external_id if customer_external_id != OMIT @salutation = salutation if salutation != OMIT @first_name = first_name if first_name != OMIT @last_name = last_name if last_name != OMIT @email = email if email != OMIT @phone = phone if phone != OMIT @billing_street = billing_street if billing_street != OMIT @billing_city = billing_city if billing_city != OMIT @billing_state_province = billing_state_province if billing_state_province != OMIT @billing_country = billing_country if billing_country != OMIT @billing_postal_code = billing_postal_code if billing_postal_code != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "externalId": external_id, "organizationId": organization_id, "customerId": customer_id, "customerExternalId": customer_external_id, "salutation": salutation, "firstName": first_name, "lastName": last_name, "email": email, "phone": phone, "billingStreet": billing_street, "billingCity": billing_city, "billingStateProvince": billing_state_province, "billingCountry": billing_country, "billingPostalCode": billing_postal_code }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
39 40 41 |
# File 'lib/paid_ruby/types/contact.rb', line 39 def additional_properties @additional_properties end |
#billing_city ⇒ String (readonly)
31 32 33 |
# File 'lib/paid_ruby/types/contact.rb', line 31 def billing_city @billing_city end |
#billing_country ⇒ String (readonly)
35 36 37 |
# File 'lib/paid_ruby/types/contact.rb', line 35 def billing_country @billing_country end |
#billing_postal_code ⇒ String (readonly)
37 38 39 |
# File 'lib/paid_ruby/types/contact.rb', line 37 def billing_postal_code @billing_postal_code end |
#billing_state_province ⇒ String (readonly)
33 34 35 |
# File 'lib/paid_ruby/types/contact.rb', line 33 def billing_state_province @billing_state_province end |
#billing_street ⇒ String (readonly)
29 30 31 |
# File 'lib/paid_ruby/types/contact.rb', line 29 def billing_street @billing_street end |
#customer_external_id ⇒ String (readonly)
17 18 19 |
# File 'lib/paid_ruby/types/contact.rb', line 17 def customer_external_id @customer_external_id end |
#customer_id ⇒ String (readonly)
15 16 17 |
# File 'lib/paid_ruby/types/contact.rb', line 15 def customer_id @customer_id end |
#email ⇒ String (readonly)
25 26 27 |
# File 'lib/paid_ruby/types/contact.rb', line 25 def email @email end |
#external_id ⇒ String (readonly)
11 12 13 |
# File 'lib/paid_ruby/types/contact.rb', line 11 def external_id @external_id end |
#first_name ⇒ String (readonly)
21 22 23 |
# File 'lib/paid_ruby/types/contact.rb', line 21 def first_name @first_name end |
#id ⇒ String (readonly)
9 10 11 |
# File 'lib/paid_ruby/types/contact.rb', line 9 def id @id end |
#last_name ⇒ String (readonly)
23 24 25 |
# File 'lib/paid_ruby/types/contact.rb', line 23 def last_name @last_name end |
#organization_id ⇒ String (readonly)
13 14 15 |
# File 'lib/paid_ruby/types/contact.rb', line 13 def organization_id @organization_id end |
#phone ⇒ String (readonly)
27 28 29 |
# File 'lib/paid_ruby/types/contact.rb', line 27 def phone @phone end |
#salutation ⇒ Paid::Salutation (readonly)
19 20 21 |
# File 'lib/paid_ruby/types/contact.rb', line 19 def salutation @salutation end |
Class Method Details
.from_json(json_object:) ⇒ Paid::Contact
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/paid_ruby/types/contact.rb', line 88 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] external_id = parsed_json["externalId"] organization_id = parsed_json["organizationId"] customer_id = parsed_json["customerId"] customer_external_id = parsed_json["customerExternalId"] salutation = parsed_json["salutation"] first_name = parsed_json["firstName"] last_name = parsed_json["lastName"] email = parsed_json["email"] phone = parsed_json["phone"] billing_street = parsed_json["billingStreet"] billing_city = parsed_json["billingCity"] billing_state_province = parsed_json["billingStateProvince"] billing_country = parsed_json["billingCountry"] billing_postal_code = parsed_json["billingPostalCode"] new( id: id, external_id: external_id, organization_id: organization_id, customer_id: customer_id, customer_external_id: customer_external_id, salutation: salutation, first_name: first_name, last_name: last_name, email: email, phone: phone, billing_street: billing_street, billing_city: billing_city, billing_state_province: billing_state_province, billing_country: billing_country, billing_postal_code: billing_postal_code, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/paid_ruby/types/contact.rb', line 137 def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") obj.organization_id&.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.") obj.customer_id&.is_a?(String) != false || raise("Passed value for field obj.customer_id is not the expected type, validation failed.") obj.customer_external_id&.is_a?(String) != false || raise("Passed value for field obj.customer_external_id is not the expected type, validation failed.") obj.salutation&.is_a?(Paid::Salutation) != false || raise("Passed value for field obj.salutation is not the expected type, validation failed.") obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.") obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.") obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.") obj.billing_street&.is_a?(String) != false || raise("Passed value for field obj.billing_street is not the expected type, validation failed.") obj.billing_city&.is_a?(String) != false || raise("Passed value for field obj.billing_city is not the expected type, validation failed.") obj.billing_state_province&.is_a?(String) != false || raise("Passed value for field obj.billing_state_province is not the expected type, validation failed.") obj.billing_country&.is_a?(String) != false || raise("Passed value for field obj.billing_country is not the expected type, validation failed.") obj.billing_postal_code&.is_a?(String) != false || raise("Passed value for field obj.billing_postal_code is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
128 129 130 |
# File 'lib/paid_ruby/types/contact.rb', line 128 def to_json @_field_set&.to_json end |