Method: OpenapiClient::ConnectCarrierRequestBody#valid?

Defined in:
lib/openapi_client/models/connect_carrier_request_body.rb

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
# File 'lib/openapi_client/models/connect_carrier_request_body.rb', line 843

def valid?
  return false if @nickname.nil?
  return false if @nickname.to_s.length < 1
  return false if @username.nil?
  return false if @username.to_s.length < 1
  return false if @password.nil?
  return false if @password.to_s.length < 1
  return false if @merchant_seller_id.nil?
  return false if @merchant_seller_id.to_s.length < 1
  return false if @mws_auth_token.nil?
  return false if @mws_auth_token.to_s.length < 1
  return false if @email.nil?
  return false if @account_number.nil?
  return false if @account_number.to_s.length < 1
  return false if @ftp_username.nil?
  return false if @ftp_username.to_s.length < 1
  return false if @ftp_password.nil?
  return false if @ftp_password.to_s.length < 1
  return false if @api_key.nil?
  return false if @api_key.to_s.length < 1
  return false if @api_secret.nil?
  return false if @api_secret.to_s.length < 1
  return false if @contract_id.nil?
  return false if @contract_id.to_s.length < 1
  return false if @client_id.nil?
  return false if @client_id.to_s.length < 1
  return false if @pickup_number.nil?
  return false if @pickup_number.to_s.length < 1
  return false if @distribution_center.nil?
  return false if @distribution_center.to_s.length < 1
  return false if @site_id.nil?
  return false if @account.nil?
  return false if @account.to_s.length < 1
  return false if @passphrase.nil?
  return false if @passphrase.to_s.length < 1
  return false if @address1.nil?
  return false if @address1.to_s.length < 1
  return false if !@address2.nil? && @address2.to_s.length < 1
  return false if @city.nil?
  return false if @city.to_s.length < 1
  return false if @company.nil?
  return false if @company.to_s.length < 1
  return false if @country_code.nil?
  return false if @country_code.to_s.length < 1
  return false if @first_name.nil?
  return false if @first_name.to_s.length < 1
  return false if @last_name.nil?
  return false if @last_name.to_s.length < 1
  return false if @phone.nil?
  return false if @phone.to_s.length < 1
  return false if @postal_code.nil?
  return false if @postal_code.to_s.length < 1
  return false if @state.nil?
  return false if @state.to_s.length < 1
  return false if @agree_to_eula.nil?
  return false if !@meter_number.nil? && @meter_number.to_s.length < 1
  return false if @mailer_id.nil?
  return false if @mailer_id < 0
  return false if !@profile_name.nil? && @profile_name.to_s.length < 1
  return false if !@merchant_id.nil? && @merchant_id < 0
  return false if @induction_site.nil?
  return false if @induction_site.to_s.length < 1
  return false if @activation_key.nil?
  return false if @activation_key.to_s.length < 1
  return false if @contact_name.nil?
  return false if @contact_name.to_s.length < 1
  return false if !@company_name.nil? && @company_name.to_s.length < 1
  return false if !@street_line1.nil? && @street_line1.to_s.length < 1
  return false if !@street_line2.nil? && @street_line2.to_s.length < 1
  return false if !@street_line3.nil? && @street_line3.to_s.length < 1
  return false if @access_key.nil?
  return false if @access_key.to_s.length < 1
  return false if @sendle_id.nil?
  return false if @account_country_code.nil?
  return false if @account_country_code.to_s.length < 1
  return false if @account_postal_code.nil?
  return false if @account_postal_code.to_s.length < 1
  return false if !@title.nil? && @title.to_s.length < 1
  return false if @agree_to_technology_agreement.nil?
  _one_of_found = false
  self.class.openapi_one_of.each do |_class|
    _one_of = OpenapiClient.const_get(_class).build_from_hash(self.to_hash)
    if _one_of.valid?
      if _one_of_found
        return false
      else
        _one_of_found = true
      end
    end
  end

  if !_one_of_found
    return false
  end

  true
end