Method: TransferZero::Sender#valid?
- Defined in:
- lib/transferzero-sdk/models/sender.rb
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 |
# File 'lib/transferzero-sdk/models/sender.rb', line 669 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 @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", "mto"]) 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 |