Class: TransferZero::Sender
- Inherits:
-
Object
- Object
- TransferZero::Sender
- Defined in:
- lib/transferzero-sdk/models/sender.rb
Overview
This contains the details of the sender. The first time a specific sender is used the full details should be provided. Once a sender is created and is used, the next time you MUST only send the ID of the sender. This is so we can match the same sender across multiple transactions for KYC and audit purposes. Personal Sender Example: “‘json { "country": "UG", "phone_country": "UG", "phone_number": "752403639", "email": "[email protected]", "first_name": "Johnny", "last_name": "English", "city": "Kampala", "street": "Unknown 17-3", "address_description": "Description of address", "postal_code": "798983", "birth_date": "1900-12-31", "documents": [ ], "politically_exposed_people": [ ], "ip": "127.0.0.1", "identification_number": "AB123456", "identification_type": "ID", "external_id": "806ec63a-a5a7-43cc-9d75-1ee74fbcc026", "metadata": { } } “` Business Sender Example: “`json { "type": "business", "country": "UG", "phone_country": "UG", "phone_number": "752403639", "email": "[email protected]", "name": "MyCompany", "city": "Kampala", "street": "Unknown 17-3", "postal_code": "798983", "address_description": "Description of address", "documents": [ ], "politically_exposed_people": [ ], "ip": "127.0.0.1", "identification_number": "AB123456", "identification_type": "ID", "external_id": "806ec63a-a5a7-43cc-9d75-1ee74fbcc026", "metadata": { } } “` [Sender in the API documentation](docs.transferzero.com/docs/transaction-flow/#sender)
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#address_description ⇒ Object
Description of address.
-
#amount_monthly_transactions ⇒ Object
The estimated amount for all transactions each month in USD (used only with a Business sender).
-
#birth_date ⇒ Object
Date of birth of sender (used only with a Personal sender).
-
#city ⇒ Object
Sender’s city.
-
#contact_person_email ⇒ Object
The contact’s email address (used only with a Business sender).
-
#core_business_activities ⇒ Object
The core activities (used only with a Business sender).
-
#country ⇒ Object
Country of sender in 2-character alpha ISO 3166-2 country format.
-
#documents ⇒ Object
Needed for KYC checks.
-
#email ⇒ Object
Email of sender.
-
#errors ⇒ Object
The fields that have some problems and don’t pass validation.
-
#external_id ⇒ Object
Optional ID that is supplied by partner linking it to the partner’s own Sender ID.
-
#financial_regulator ⇒ Object
The Financial Regulator (used only with a Business sender).
-
#first_name ⇒ Object
First name of sender (used only with a Personal sender).
-
#id ⇒ Object
Returns the value of attribute id.
-
#identification_number ⇒ Object
Identification number of document used.
-
#identification_type ⇒ Object
Document to be identified.
-
#ip ⇒ Object
IP of sender.
-
#last_name ⇒ Object
Last name of sender (used only with a Personal sender).
-
#legal_entity_type ⇒ Object
Legal entity type (used only with a Business sender).
-
#metadata ⇒ Object
Metadata of sender.
-
#middle_name ⇒ Object
Middle name of sender (used only with a Personal sender).
-
#name ⇒ Object
Name of sender (used only with a Business sender).
-
#nationality ⇒ Object
The nationality of the sender (used only with a Personal sender).
-
#nature_of_business ⇒ Object
Nature of business options (used only with a Business sender).
-
#number_monthly_transactions ⇒ Object
The estimated number of monthly transactions (used only with a Business sender).
-
#occupation ⇒ Object
Occupation of sender (used only with a Personal sender).
-
#office_phone ⇒ Object
The official phone number (used only with a Business sender).
-
#onboarding_status ⇒ Object
The onboarding status of the sender.
-
#phone_country ⇒ Object
Phone country of sender in 2-character alpha ISO 3166-2 country format.
-
#phone_number ⇒ Object
Phone number of sender (without country callcode).
-
#politically_exposed_people ⇒ Object
An optional list of politically exposed people, individuals who are or have been entrusted with prominent public functions by a country, for example heads of state or heads of government, senior politicians, senior government, judicial or military officials, senior executives of state owned corporations, important political party officials.
-
#postal_code ⇒ Object
Zip code of sender.
-
#purpose_of_opening_account ⇒ Object
The purpose for opening their account (used only with a Business sender).
-
#registration_date ⇒ Object
The registration date (used only with a Business sender).
-
#registration_number ⇒ Object
The registration number (used only with a Business sender).
-
#regulatory_licence_number ⇒ Object
The Regulatory Licence Number (used only with a Business sender).
-
#source_of_funds ⇒ Object
The source of funds.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Sender’s street.
-
#trading_address ⇒ Object
The Business trading address (used only with a Business sender).
-
#trading_country ⇒ Object
The Business trading country (used only with a Business sender).
-
#type ⇒ Object
Type of sender to create - either person or business (defaults to person).
-
#vat_registration_number ⇒ Object
The VAT registration number (used only with a Business sender).
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #[](key) ⇒ Object
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Returns the model itself.
- #dig(*args) ⇒ Object
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Sender
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Sender
Initializes the object
267 268 269 270 271 272 273 274 275 276 277 278 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 361 362 363 364 365 366 367 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 |
# File 'lib/transferzero-sdk/models/sender.rb', line 267 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Sender` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Sender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'street') self.street = attributes[:'street'] end if attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'phone_country') self.phone_country = attributes[:'phone_country'] end if attributes.key?(:'phone_number') self.phone_number = attributes[:'phone_number'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'ip') self.ip = attributes[:'ip'] end if attributes.key?(:'address_description') self.address_description = attributes[:'address_description'] end if attributes.key?(:'identification_number') self.identification_number = attributes[:'identification_number'] end if attributes.key?(:'identification_type') self.identification_type = attributes[:'identification_type'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'middle_name') self.middle_name = attributes[:'middle_name'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'birth_date') self.birth_date = attributes[:'birth_date'] end if attributes.key?(:'occupation') self.occupation = attributes[:'occupation'] end if attributes.key?(:'nationality') self.nationality = attributes[:'nationality'] end if attributes.key?(:'legal_entity_type') self.legal_entity_type = attributes[:'legal_entity_type'] end if attributes.key?(:'registration_date') self.registration_date = attributes[:'registration_date'] end if attributes.key?(:'registration_number') self.registration_number = attributes[:'registration_number'] end if attributes.key?(:'nature_of_business') self.nature_of_business = attributes[:'nature_of_business'] end if attributes.key?(:'source_of_funds') self.source_of_funds = attributes[:'source_of_funds'] end if attributes.key?(:'core_business_activities') self.core_business_activities = attributes[:'core_business_activities'] end if attributes.key?(:'purpose_of_opening_account') self.purpose_of_opening_account = attributes[:'purpose_of_opening_account'] end if attributes.key?(:'office_phone') self.office_phone = attributes[:'office_phone'] end if attributes.key?(:'vat_registration_number') self.vat_registration_number = attributes[:'vat_registration_number'] end if attributes.key?(:'financial_regulator') self.financial_regulator = attributes[:'financial_regulator'] end if attributes.key?(:'regulatory_licence_number') self.regulatory_licence_number = attributes[:'regulatory_licence_number'] end if attributes.key?(:'contact_person_email') self.contact_person_email = attributes[:'contact_person_email'] end if attributes.key?(:'trading_country') self.trading_country = attributes[:'trading_country'] end if attributes.key?(:'trading_address') self.trading_address = attributes[:'trading_address'] end if attributes.key?(:'number_monthly_transactions') self.number_monthly_transactions = attributes[:'number_monthly_transactions'] end if attributes.key?(:'amount_monthly_transactions') self.amount_monthly_transactions = attributes[:'amount_monthly_transactions'] end if attributes.key?(:'documents') if (value = attributes[:'documents']).is_a?(Array) self.documents = value end end if attributes.key?(:'metadata') self. = attributes[:'metadata'] end if attributes.key?(:'errors') if (value = attributes[:'errors']).is_a?(Hash) self.errors = value end end if attributes.key?(:'onboarding_status') self.onboarding_status = attributes[:'onboarding_status'] end if attributes.key?(:'politically_exposed_people') if (value = attributes[:'politically_exposed_people']).is_a?(Array) self.politically_exposed_people = value end end if attributes.key?(:'external_id') self.external_id = attributes[:'external_id'] end end |
Instance Attribute Details
#address_description ⇒ Object
Description of address
50 51 52 |
# File 'lib/transferzero-sdk/models/sender.rb', line 50 def address_description @address_description end |
#amount_monthly_transactions ⇒ Object
The estimated amount for all transactions each month in USD (used only with a Business sender)
125 126 127 |
# File 'lib/transferzero-sdk/models/sender.rb', line 125 def amount_monthly_transactions @amount_monthly_transactions end |
#birth_date ⇒ Object
Date of birth of sender (used only with a Personal sender)
71 72 73 |
# File 'lib/transferzero-sdk/models/sender.rb', line 71 def birth_date @birth_date end |
#city ⇒ Object
Sender’s city
35 36 37 |
# File 'lib/transferzero-sdk/models/sender.rb', line 35 def city @city end |
#contact_person_email ⇒ Object
The contact’s email address (used only with a Business sender)
113 114 115 |
# File 'lib/transferzero-sdk/models/sender.rb', line 113 def contact_person_email @contact_person_email end |
#core_business_activities ⇒ Object
The core activities (used only with a Business sender)
95 96 97 |
# File 'lib/transferzero-sdk/models/sender.rb', line 95 def core_business_activities @core_business_activities end |
#country ⇒ Object
Country of sender in 2-character alpha ISO 3166-2 country format
26 27 28 |
# File 'lib/transferzero-sdk/models/sender.rb', line 26 def country @country end |
#documents ⇒ Object
Needed for KYC checks. Required to approve the sender unless KYC is waived for your account. Please send us an empty list of documents: ‘"documents": [ ]` in the request if KYC has been waived. If the documents already exist, please send the Document ID eg. “`JSON "documents": [ { "id": "b6648ba3-1c7b-4f59-8580-684899c84a07" } ] “`
128 129 130 |
# File 'lib/transferzero-sdk/models/sender.rb', line 128 def documents @documents end |
#email ⇒ Object
Email of sender
44 45 46 |
# File 'lib/transferzero-sdk/models/sender.rb', line 44 def email @email end |
#errors ⇒ Object
The fields that have some problems and don’t pass validation
134 135 136 |
# File 'lib/transferzero-sdk/models/sender.rb', line 134 def errors @errors end |
#external_id ⇒ Object
Optional ID that is supplied by partner linking it to the partner’s own Sender ID. Note: if present we will validate whether the sent ID is a duplicate in our system or not.
143 144 145 |
# File 'lib/transferzero-sdk/models/sender.rb', line 143 def external_id @external_id end |
#financial_regulator ⇒ Object
The Financial Regulator (used only with a Business sender)
107 108 109 |
# File 'lib/transferzero-sdk/models/sender.rb', line 107 def financial_regulator @financial_regulator end |
#first_name ⇒ Object
First name of sender (used only with a Personal sender)
62 63 64 |
# File 'lib/transferzero-sdk/models/sender.rb', line 62 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
18 19 20 |
# File 'lib/transferzero-sdk/models/sender.rb', line 18 def id @id end |
#identification_number ⇒ Object
Identification number of document used
53 54 55 |
# File 'lib/transferzero-sdk/models/sender.rb', line 53 def identification_number @identification_number end |
#identification_type ⇒ Object
Document to be identified. The identification type can be one of the following: - ‘DL`: Driving License - `PP`: International Passport - `ID`: National ID - `OT`: Other
56 57 58 |
# File 'lib/transferzero-sdk/models/sender.rb', line 56 def identification_type @identification_type end |
#ip ⇒ Object
IP of sender
47 48 49 |
# File 'lib/transferzero-sdk/models/sender.rb', line 47 def ip @ip end |
#last_name ⇒ Object
Last name of sender (used only with a Personal sender)
68 69 70 |
# File 'lib/transferzero-sdk/models/sender.rb', line 68 def last_name @last_name end |
#legal_entity_type ⇒ Object
Legal entity type (used only with a Business sender)
80 81 82 |
# File 'lib/transferzero-sdk/models/sender.rb', line 80 def legal_entity_type @legal_entity_type end |
#metadata ⇒ Object
Metadata of sender. You can store any detail specific to your integration here (for example the local ID of the sender on your end). When requesting sender details you will receive the sent metadata back. Also when sending sender related webhooks you will receive the details stored here as well.
131 132 133 |
# File 'lib/transferzero-sdk/models/sender.rb', line 131 def @metadata end |
#middle_name ⇒ Object
Middle name of sender (used only with a Personal sender)
65 66 67 |
# File 'lib/transferzero-sdk/models/sender.rb', line 65 def middle_name @middle_name end |
#name ⇒ Object
Name of sender (used only with a Business sender)
59 60 61 |
# File 'lib/transferzero-sdk/models/sender.rb', line 59 def name @name end |
#nationality ⇒ Object
The nationality of the sender (used only with a Personal sender)
77 78 79 |
# File 'lib/transferzero-sdk/models/sender.rb', line 77 def nationality @nationality end |
#nature_of_business ⇒ Object
Nature of business options (used only with a Business sender)
89 90 91 |
# File 'lib/transferzero-sdk/models/sender.rb', line 89 def nature_of_business @nature_of_business end |
#number_monthly_transactions ⇒ Object
The estimated number of monthly transactions (used only with a Business sender)
122 123 124 |
# File 'lib/transferzero-sdk/models/sender.rb', line 122 def number_monthly_transactions @number_monthly_transactions end |
#occupation ⇒ Object
Occupation of sender (used only with a Personal sender)
74 75 76 |
# File 'lib/transferzero-sdk/models/sender.rb', line 74 def occupation @occupation end |
#office_phone ⇒ Object
The official phone number (used only with a Business sender)
101 102 103 |
# File 'lib/transferzero-sdk/models/sender.rb', line 101 def office_phone @office_phone end |
#onboarding_status ⇒ Object
The onboarding status of the sender
137 138 139 |
# File 'lib/transferzero-sdk/models/sender.rb', line 137 def onboarding_status @onboarding_status end |
#phone_country ⇒ Object
Phone country of sender in 2-character alpha ISO 3166-2 country format
38 39 40 |
# File 'lib/transferzero-sdk/models/sender.rb', line 38 def phone_country @phone_country end |
#phone_number ⇒ Object
Phone number of sender (without country callcode)
41 42 43 |
# File 'lib/transferzero-sdk/models/sender.rb', line 41 def phone_number @phone_number end |
#politically_exposed_people ⇒ Object
An optional list of politically exposed people, individuals who are or have been entrusted with prominent public functions by a country, for example heads of state or heads of government, senior politicians, senior government, judicial or military officials, senior executives of state owned corporations, important political party officials. There is a limit of three (3) politically exposed people per Sender. Politically exposed person example: “‘json { "politically_exposed_person": { "name": "Ronald Reagan", "position": "President of the United States", "started_date": "1981-01-20T00:00:00.000Z", "ended_date": "1989-01-20T00:00:00.000Z", "sender_id": "344fb668-196d-43db-9d94-b34b7e6c7e0b" } } “`
140 141 142 |
# File 'lib/transferzero-sdk/models/sender.rb', line 140 def politically_exposed_people @politically_exposed_people end |
#postal_code ⇒ Object
Zip code of sender
32 33 34 |
# File 'lib/transferzero-sdk/models/sender.rb', line 32 def postal_code @postal_code end |
#purpose_of_opening_account ⇒ Object
The purpose for opening their account (used only with a Business sender)
98 99 100 |
# File 'lib/transferzero-sdk/models/sender.rb', line 98 def purpose_of_opening_account @purpose_of_opening_account end |
#registration_date ⇒ Object
The registration date (used only with a Business sender)
83 84 85 |
# File 'lib/transferzero-sdk/models/sender.rb', line 83 def registration_date @registration_date end |
#registration_number ⇒ Object
The registration number (used only with a Business sender)
86 87 88 |
# File 'lib/transferzero-sdk/models/sender.rb', line 86 def registration_number @registration_number end |
#regulatory_licence_number ⇒ Object
The Regulatory Licence Number (used only with a Business sender)
110 111 112 |
# File 'lib/transferzero-sdk/models/sender.rb', line 110 def regulatory_licence_number @regulatory_licence_number end |
#source_of_funds ⇒ Object
The source of funds
92 93 94 |
# File 'lib/transferzero-sdk/models/sender.rb', line 92 def source_of_funds @source_of_funds end |
#state ⇒ Object
Returns the value of attribute state.
23 24 25 |
# File 'lib/transferzero-sdk/models/sender.rb', line 23 def state @state end |
#street ⇒ Object
Sender’s street
29 30 31 |
# File 'lib/transferzero-sdk/models/sender.rb', line 29 def street @street end |
#trading_address ⇒ Object
The Business trading address (used only with a Business sender)
119 120 121 |
# File 'lib/transferzero-sdk/models/sender.rb', line 119 def trading_address @trading_address end |
#trading_country ⇒ Object
The Business trading country (used only with a Business sender)
116 117 118 |
# File 'lib/transferzero-sdk/models/sender.rb', line 116 def trading_country @trading_country end |
#type ⇒ Object
Type of sender to create - either person or business (defaults to person)
21 22 23 |
# File 'lib/transferzero-sdk/models/sender.rb', line 21 def type @type end |
#vat_registration_number ⇒ Object
The VAT registration number (used only with a Business sender)
104 105 106 |
# File 'lib/transferzero-sdk/models/sender.rb', line 104 def vat_registration_number @vat_registration_number end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
168 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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/transferzero-sdk/models/sender.rb', line 168 def self.attribute_map { :'id' => :'id', :'type' => :'type', :'state' => :'state', :'country' => :'country', :'street' => :'street', :'postal_code' => :'postal_code', :'city' => :'city', :'phone_country' => :'phone_country', :'phone_number' => :'phone_number', :'email' => :'email', :'ip' => :'ip', :'address_description' => :'address_description', :'identification_number' => :'identification_number', :'identification_type' => :'identification_type', :'name' => :'name', :'first_name' => :'first_name', :'middle_name' => :'middle_name', :'last_name' => :'last_name', :'birth_date' => :'birth_date', :'occupation' => :'occupation', :'nationality' => :'nationality', :'legal_entity_type' => :'legal_entity_type', :'registration_date' => :'registration_date', :'registration_number' => :'registration_number', :'nature_of_business' => :'nature_of_business', :'source_of_funds' => :'source_of_funds', :'core_business_activities' => :'core_business_activities', :'purpose_of_opening_account' => :'purpose_of_opening_account', :'office_phone' => :'office_phone', :'vat_registration_number' => :'vat_registration_number', :'financial_regulator' => :'financial_regulator', :'regulatory_licence_number' => :'regulatory_licence_number', :'contact_person_email' => :'contact_person_email', :'trading_country' => :'trading_country', :'trading_address' => :'trading_address', :'number_monthly_transactions' => :'number_monthly_transactions', :'amount_monthly_transactions' => :'amount_monthly_transactions', :'documents' => :'documents', :'metadata' => :'metadata', :'errors' => :'errors', :'onboarding_status' => :'onboarding_status', :'politically_exposed_people' => :'politically_exposed_people', :'external_id' => :'external_id' } end |
.openapi_types ⇒ Object
Attribute type mapping.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 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 |
# File 'lib/transferzero-sdk/models/sender.rb', line 217 def self.openapi_types { :'id' => :'String', :'type' => :'String', :'state' => :'SenderState', :'country' => :'String', :'street' => :'String', :'postal_code' => :'String', :'city' => :'String', :'phone_country' => :'String', :'phone_number' => :'String', :'email' => :'String', :'ip' => :'String', :'address_description' => :'String', :'identification_number' => :'String', :'identification_type' => :'String', :'name' => :'String', :'first_name' => :'String', :'middle_name' => :'String', :'last_name' => :'String', :'birth_date' => :'Date', :'occupation' => :'String', :'nationality' => :'String', :'legal_entity_type' => :'String', :'registration_date' => :'String', :'registration_number' => :'String', :'nature_of_business' => :'String', :'source_of_funds' => :'String', :'core_business_activities' => :'String', :'purpose_of_opening_account' => :'String', :'office_phone' => :'String', :'vat_registration_number' => :'String', :'financial_regulator' => :'String', :'regulatory_licence_number' => :'String', :'contact_person_email' => :'String', :'trading_country' => :'String', :'trading_address' => :'String', :'number_monthly_transactions' => :'String', :'amount_monthly_transactions' => :'String', :'documents' => :'Array<Document>', :'metadata' => :'Object', :'errors' => :'Hash<String, Array<ValidationErrorDescription>>', :'onboarding_status' => :'String', :'politically_exposed_people' => :'Array<PoliticallyExposedPerson>', :'external_id' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/transferzero-sdk/models/sender.rb', line 550 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && type == o.type && state == o.state && country == o.country && street == o.street && postal_code == o.postal_code && city == o.city && phone_country == o.phone_country && phone_number == o.phone_number && email == o.email && ip == o.ip && address_description == o.address_description && identification_number == o.identification_number && identification_type == o.identification_type && name == o.name && first_name == o.first_name && middle_name == o.middle_name && last_name == o.last_name && birth_date == o.birth_date && occupation == o.occupation && nationality == o.nationality && legal_entity_type == o.legal_entity_type && registration_date == o.registration_date && registration_number == o.registration_number && nature_of_business == o.nature_of_business && source_of_funds == o.source_of_funds && core_business_activities == o.core_business_activities && purpose_of_opening_account == o.purpose_of_opening_account && office_phone == o.office_phone && vat_registration_number == o.vat_registration_number && financial_regulator == o.financial_regulator && regulatory_licence_number == o.regulatory_licence_number && contact_person_email == o.contact_person_email && trading_country == o.trading_country && trading_address == o.trading_address && number_monthly_transactions == o.number_monthly_transactions && amount_monthly_transactions == o.amount_monthly_transactions && documents == o.documents && == o. && errors == o.errors && onboarding_status == o.onboarding_status && politically_exposed_people == o.politically_exposed_people && external_id == o.external_id end |
#[](key) ⇒ Object
698 699 700 |
# File 'lib/transferzero-sdk/models/sender.rb', line 698 def [](key) to_hash[key] end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 |
# File 'lib/transferzero-sdk/models/sender.rb', line 636 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = TransferZero.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/transferzero-sdk/models/sender.rb', line 710 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Returns the model itself
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 |
# File 'lib/transferzero-sdk/models/sender.rb', line 615 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#dig(*args) ⇒ Object
702 703 704 |
# File 'lib/transferzero-sdk/models/sender.rb', line 702 def dig(*args) to_hash.dig(*args) end |
#eql?(o) ⇒ Boolean
600 601 602 |
# File 'lib/transferzero-sdk/models/sender.rb', line 600 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
606 607 608 |
# File 'lib/transferzero-sdk/models/sender.rb', line 606 def hash [id, type, state, country, street, postal_code, city, phone_country, phone_number, email, ip, address_description, identification_number, identification_type, name, first_name, middle_name, last_name, birth_date, occupation, nationality, legal_entity_type, registration_date, registration_number, nature_of_business, source_of_funds, core_business_activities, purpose_of_opening_account, office_phone, vat_registration_number, financial_regulator, regulatory_licence_number, contact_person_email, trading_country, trading_address, number_monthly_transactions, amount_monthly_transactions, documents, , errors, onboarding_status, politically_exposed_people, external_id].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/transferzero-sdk/models/sender.rb', line 461 def list_invalid_properties invalid_properties = Array.new if @country.nil? invalid_properties.push('invalid value for "country", country cannot be nil.') end if @street.nil? invalid_properties.push('invalid value for "street", street cannot be nil.') end if @postal_code.nil? invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') end if @city.nil? invalid_properties.push('invalid value for "city", city cannot be nil.') end if @phone_country.nil? invalid_properties.push('invalid value for "phone_country", phone_country cannot be nil.') end if @email.nil? invalid_properties.push('invalid value for "email", email cannot be nil.') end if @ip.nil? invalid_properties.push('invalid value for "ip", ip cannot be nil.') end if @documents.nil? invalid_properties.push('invalid value for "documents", documents cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
682 683 684 |
# File 'lib/transferzero-sdk/models/sender.rb', line 682 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
688 689 690 691 692 693 694 695 696 |
# File 'lib/transferzero-sdk/models/sender.rb', line 688 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end ::ActiveSupport::HashWithIndifferentAccess.new(hash) end |
#to_s ⇒ String
Returns the string representation of the object
676 677 678 |
# File 'lib/transferzero-sdk/models/sender.rb', line 676 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/transferzero-sdk/models/sender.rb', line 500 def valid? type_validator = EnumAttributeValidator.new('String', ["person", "business"]) return false unless type_validator.valid?(@type) return false if @country.nil? return false if @street.nil? return false if @postal_code.nil? return false if @city.nil? return false if @phone_country.nil? return false if @email.nil? return false if @ip.nil? identification_type_validator = EnumAttributeValidator.new('String', ["DL", "PP", "ID", "OT"]) return false unless identification_type_validator.valid?(@identification_type) legal_entity_type_validator = EnumAttributeValidator.new('String', ["sole_proprietorship", "partnership", "privately_owned_company", "publicly_owned_company", "government_owned_entity", "trust", "ngo", "club_and_society", "go", "other", "financial_institution"]) return false unless legal_entity_type_validator.valid?(@legal_entity_type) return false if @documents.nil? true end |