Method: UltracartClient::OrderQuery#valid?

Defined in:
lib/ultracart_api/models/order_query.rb

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/ultracart_api/models/order_query.rb', line 523

def valid?
  return false if !@cc_email.nil? && @cc_email.to_s.length > 100
  return false if !@city.nil? && @city.to_s.length > 32
  return false if !@company.nil? && @company.to_s.length > 50
  return false if !@country_code.nil? && @country_code.to_s.length > 2
  current_stage_validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown"])
  return false unless current_stage_validator.valid?(@current_stage)
  return false if !@email.nil? && @email.to_s.length > 100
  return false if !@first_name.nil? && @first_name.to_s.length > 30
  return false if !@last_name.nil? && @last_name.to_s.length > 30
  payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay", "PayPal Fastlane"])
  return false unless payment_method_validator.valid?(@payment_method)
  return false if !@phone.nil? && @phone.to_s.length > 25
  return false if !@postal_code.nil? && @postal_code.to_s.length > 20
  query_target_validator = EnumAttributeValidator.new('String', ["origin", "cache"])
  return false unless query_target_validator.valid?(@query_target)
  return false if !@rma.nil? && @rma.to_s.length > 30
  return false if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
  return false if !@state_region.nil? && @state_region.to_s.length > 32
  true
end