class TransferZero::Sender
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 { // name "first_name": "Jane", "last_name": "Doe", // address "country": "US", "city": "New York", "street": "20 W 34th St", "postal_code": "10001", "address_description": "", // DOB "birth_date": "1974-12-24", // Contact Details; You can usually use your company's contact details here "phone_country": "US", "phone_number": "5555551234", "email": "info@transferzero.com", // ID of the sender in your system "external_id": "Sender:US:234523", // these fields are mandatory, but you can usually leave them with the following default values: "documents": [ ], "ip": "127.0.0.1", "metadata": {} } “` Business Sender
Example: “`json { "type": "business", "name": "Company name", // Country of Incorporation "country": "US", // Trading address of the company "trading_country": "US", "city": "New York", "street": "20 W 34th St", "postal_code": "10001", "address_description": "", // Company Details "legal_entity_type": "privately_owned_company", "registration_date": "2012-01-25", "registration_number": "VAT1234567", "nature_of_business": "retail_trade", // Contact Details "phone_country": "US", "phone_number": "5555551234", "email": "example@home.org", // ID of the sender in your system "external_id": "Sender:Business:US:234523", // these fields are mandatory, but you can usually leave them with the following default values: "documents": [ ], "ip": "127.0.0.1", "metadata": {} } “` [Sender in the API documentation](docs.transferzero.com/docs/transaction-flow/#sender)
Attributes
Description of address
The estimated amount for all transactions each month in USD (used only with a Business sender)
Date of birth of sender (used only with a Personal sender)
Sender's city
City of birth of sender
The contact's email address (used only with a Business sender)
The core activity (used only with a Business sender)
Country of sender in 2-character alpha ISO 3166-2 country format. This is the residential country for personal senders and the country of incorporation for business senders.
Country of birth of sender in 2-character alpha ISO 3166-2 country format
Date and time of sender was created
Custom source of funds
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" } ] “`
Email of sender
The fields that have some problems and don't pass validation
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.
The Financial Regulator (used only with a Business sender)
First name of sender (used only with a Personal sender)
The gender of the sender: - `M`: Male - `F`: Female - `O`: Other
Identification number of document used
Document
to be identified. The identification type can be one of the following: - `DL`: Driving License - `PP`: International Passport - `ID`: National ID - `OT`: Other Please note for Wizall `XOF::Cash` transactions the valid options are: - `ID`: National ID - `PP`: Passport
IP of sender
Determines language of the served content. Defaults to English
Last name of sender (used only with a Personal sender)
Legal entity type (used only with a Business sender) Available values: - sole_proprietorship: Sole Proprietorship - partnership: Partnership - privately_owned_company: Privately Owned Company (Limited Company) - publicly_owned_company: Publicly Listed Company (PLC) - government_owned_entity: Government Owned Entity Trusts - trust: Foundations & Similar Entities - ngo: Non-Government Organisations / Charities inc Religious bodies and place of worship - club_and_society: Clubs and Societies - go: GO (Majority Owned Subsidiary of State-Owned Company) - financial_institution: Financial Institution Please note not all values are acceptable for some our corridors. Please reach out to our sales teams for more information. Note that if you select `financial_institution` then the fields `vat_registration_number`, `financial_regulator` and `regulatory_licence_number` will be mandatory as well.
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.
Middle name of sender (used only with a Personal sender)
Name of sender (used only with a Business sender)
The nationality of the sender (used only with a Personal sender)
Nature of business options (used only with a Business sender) Available values: - personal: Personal - agriculture_and_hunting: Agriculture and Hunting - forestry: Forestry - fishing: Fishing - agricultural_by_products: Agricultural By-Products - coal_mining: Coal Mining - oil_mining: Oil Mining - iron_ore_mining: Iron Ore Mining - other_metal_and_diamond_mining: Other Metal and Diamond Mining - other_mineral_mining: Other Mineral Mining - manufacturing_of_food_drink_tobacco: Manufacture of Food/Drink/Tobacco - manufacturing_of_textiles_leather_fur_furniture: Manufacture of Textiles/Leather/Fur/Furniture - manufacture_of_wooden_products_furniture: Manufacture of Wooden Products/Furniture - manufacture_of_paper_pulp_allied_products: Manufacture of Paper/Pulp/Allied Products - manufacture_of_chemicals_medical_petroleum_rubber_plastic_products: Manufacture Of Chemicals Medical Petroleum Rubber Plastic Products - manufacture_of_pottery_china_glass_stone: Manufacture Of Pottery China Glass Stone - manufacture_of_iron_steel_non_ferrous_metals_basic_industries: Manufacture Of Iron Steel Non-Ferrous Metals Basic Industries - manufacture_of_metal_products_electrical_and_scientific_engineering: Manufacture Of Metal Products Electrical And Scientific Engineering - manufacture_of_jewelry_musical_instruments_toys: Manufacture Of Jewelry Musical Instruments Toys - electricity_gas_and_water: Electricity, Gas And Water - construction: Construction - wholesale_trade: Wholesale Trade - retail_trade: Retail Trade - catering_incl_hotels: Catering Incl. Hotels - transport_storage: Transport Storage - communications: Communications - finance_and_holding_companies: Finance And Holding Companies - insurance: Insurance - business_services: Business Services - real_estate_development_investment: Real Estate Development Investment - central_state_governments: Central State Governments - community_services_defence_police_prisons_etc: Community Services Defence Police Prisons Etc - social_services_education_health_care: Social Services Education Health Care - personal_services_leisure_services: Personal Services - Leisure Services - personal_services_domestic_laundry_repairs: Personal Services - Domestic Laundry Repairs - personal_services_embassies_international_organisations: Personal Services - Embassies
The estimated number of monthly transactions (used only with a Business sender)
Occupation of sender (used only with a Personal sender)
The official phone number (used only with a Business sender)
The onboarding status of the sender
Phone country of sender in 2-character alpha ISO 3166-2 country format
Phone number of sender (without country callcode)
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" } } “`
Zip code of sender
The purpose for opening their account (used only with a Business sender)
The registration date (used only with a Business sender)
The registration number (used only with a Business sender)
The Regulatory Licence Number (used only with a Business sender)
The source of funds
Sender's street
The Business trading address (used only with a Business sender)
The Business trading country (used only with a Business sender)
Type of sender to create - either person or business (defaults to person)
The VAT registration number (used only with a Business sender)
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/transferzero-sdk/models/sender.rb, line 186 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', :'lang' => :'lang', :'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', :'custom_source_of_funds' => :'custom_source_of_funds', :'core_business_activity' => :'core_business_activity', :'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', :'city_of_birth' => :'city_of_birth', :'country_of_birth' => :'country_of_birth', :'gender' => :'gender', :'created_at' => :'created_at' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/transferzero-sdk/models/sender.rb, line 297 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?(:'lang') self.lang = attributes[:'lang'] 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?(:'custom_source_of_funds') self.custom_source_of_funds = attributes[:'custom_source_of_funds'] end if attributes.key?(:'core_business_activity') self.core_business_activity = attributes[:'core_business_activity'] 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.metadata = 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 if attributes.key?(:'city_of_birth') self.city_of_birth = attributes[:'city_of_birth'] end if attributes.key?(:'country_of_birth') self.country_of_birth = attributes[:'country_of_birth'] end if attributes.key?(:'gender') self.gender = attributes[:'gender'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end end
Attribute type mapping.
# File lib/transferzero-sdk/models/sender.rb, line 241 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', :'lang' => :'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' => :'Date', :'registration_number' => :'String', :'nature_of_business' => :'String', :'source_of_funds' => :'String', :'custom_source_of_funds' => :'String', :'core_business_activity' => :'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', :'city_of_birth' => :'String', :'country_of_birth' => :'String', :'gender' => :'String', :'created_at' => :'String' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/transferzero-sdk/models/sender.rb, line 628 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 && lang == o.lang && 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 && custom_source_of_funds == o.custom_source_of_funds && core_business_activity == o.core_business_activity && 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 && metadata == o.metadata && errors == o.errors && onboarding_status == o.onboarding_status && politically_exposed_people == o.politically_exposed_people && external_id == o.external_id && city_of_birth == o.city_of_birth && country_of_birth == o.country_of_birth && gender == o.gender && created_at == o.created_at end
# File lib/transferzero-sdk/models/sender.rb, line 782 def [](key) to_hash[key] end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/transferzero-sdk/models/sender.rb, line 720 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
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/transferzero-sdk/models/sender.rb, line 794 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
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/transferzero-sdk/models/sender.rb, line 699 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
# File lib/transferzero-sdk/models/sender.rb, line 786 def dig(*args) to_hash.dig(*args) end
@see the `==` method @param [Object] Object to be compared
# File lib/transferzero-sdk/models/sender.rb, line 684 def eql?(o) self == o end
Custom attribute writer method checking allowed values (enum). @param [Object] gender Object to be assigned
# File lib/transferzero-sdk/models/sender.rb, line 618 def gender=(gender) validator = EnumAttributeValidator.new('String', ["M", "F", "O"]) unless validator.valid?(gender) || gender.empty? fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}." end @gender = gender end
Calculates hash code according to all attributes. @return [Integer] Hash code
# File lib/transferzero-sdk/models/sender.rb, line 690 def hash [id, type, state, country, street, postal_code, city, phone_country, phone_number, email, ip, address_description, identification_number, identification_type, lang, name, first_name, middle_name, last_name, birth_date, occupation, nationality, legal_entity_type, registration_date, registration_number, nature_of_business, source_of_funds, custom_source_of_funds, core_business_activity, 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, metadata, errors, onboarding_status, politically_exposed_people, external_id, city_of_birth, country_of_birth, gender, created_at].hash end
Custom attribute writer method checking allowed values (enum). @param [Object] identification_type
Object to be assigned
# File lib/transferzero-sdk/models/sender.rb, line 588 def identification_type=(identification_type) validator = EnumAttributeValidator.new('String', ["DL", "PP", "ID", "OT"]) unless validator.valid?(identification_type) || identification_type.empty? fail ArgumentError, "invalid value for \"identification_type\", must be one of #{validator.allowable_values}." end @identification_type = identification_type end
Custom attribute writer method checking allowed values (enum). @param [Object] legal_entity_type
Object to be assigned
# File lib/transferzero-sdk/models/sender.rb, line 598 def legal_entity_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"]) unless validator.valid?(legal_entity_type) || legal_entity_type.empty? fail ArgumentError, "invalid value for \"legal_entity_type\", must be one of #{validator.allowable_values}." end @legal_entity_type = legal_entity_type end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/transferzero-sdk/models/sender.rb, line 515 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
Custom attribute writer method checking allowed values (enum). @param [Object] nature_of_business
Object to be assigned
# File lib/transferzero-sdk/models/sender.rb, line 608 def nature_of_business=(nature_of_business) validator = EnumAttributeValidator.new('String', ["personal", "agriculture_and_hunting", "forestry", "fishing", "agricultural_by_products", "coal_mining", "oil_mining", "iron_ore_mining", "other_metal_and_diamond_mining", "other_mineral_mining", "manufacturing_of_food_drink_tobacco", "manufacturing_of_textiles_leather_fur_furniture", "manufacture_of_wooden_products_furniture", "manufacture_of_paper_pulp_allied_products", "manufacture_of_chemicals_medical_petroleum_rubber_plastic_products", "manufacture_of_pottery_china_glass_stone", "manufacture_of_iron_steel_non_ferrous_metals_basic_industries", "manufacture_of_metal_products_electrical_and_scientific_engineering", "manufacture_of_jewelry_musical_instruments_toys", "electricity_gas_and_water", "construction", "wholesale_trade", "retail_trade", "catering_incl_hotels", "transport_storage", "communications", "finance_and_holding_companies", "insurance", "business_services", "real_estate_development_investment", "central_state_governments", "community_services_defence_police_prisons_etc", "social_services_education_health_care", "personal_services_leisure_services", "personal_services_domestic_laundry_repairs", "personal_services_embassies_international_organisations"]) unless validator.valid?(nature_of_business) || nature_of_business.empty? fail ArgumentError, "invalid value for \"nature_of_business\", must be one of #{validator.allowable_values}." end @nature_of_business = nature_of_business end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/transferzero-sdk/models/sender.rb, line 772 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/transferzero-sdk/models/sender.rb, line 760 def to_s to_hash.to_s end
Custom attribute writer method checking allowed values (enum). @param [Object] type Object to be assigned
# File lib/transferzero-sdk/models/sender.rb, line 578 def type=(type) validator = EnumAttributeValidator.new('String', ["person", "business"]) unless validator.valid?(type) || type.empty? fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/transferzero-sdk/models/sender.rb, line 554 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) nature_of_business_validator = EnumAttributeValidator.new('String', ["personal", "agriculture_and_hunting", "forestry", "fishing", "agricultural_by_products", "coal_mining", "oil_mining", "iron_ore_mining", "other_metal_and_diamond_mining", "other_mineral_mining", "manufacturing_of_food_drink_tobacco", "manufacturing_of_textiles_leather_fur_furniture", "manufacture_of_wooden_products_furniture", "manufacture_of_paper_pulp_allied_products", "manufacture_of_chemicals_medical_petroleum_rubber_plastic_products", "manufacture_of_pottery_china_glass_stone", "manufacture_of_iron_steel_non_ferrous_metals_basic_industries", "manufacture_of_metal_products_electrical_and_scientific_engineering", "manufacture_of_jewelry_musical_instruments_toys", "electricity_gas_and_water", "construction", "wholesale_trade", "retail_trade", "catering_incl_hotels", "transport_storage", "communications", "finance_and_holding_companies", "insurance", "business_services", "real_estate_development_investment", "central_state_governments", "community_services_defence_police_prisons_etc", "social_services_education_health_care", "personal_services_leisure_services", "personal_services_domestic_laundry_repairs", "personal_services_embassies_international_organisations"]) return false unless nature_of_business_validator.valid?(@nature_of_business) return false if @documents.nil? gender_validator = EnumAttributeValidator.new('String', ["M", "F", "O"]) return false unless gender_validator.valid?(@gender) true end