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



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/transferzero-sdk/models/sender.rb', line 572

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