class UltracartClient::OrderQuery

Attributes

cc_email[RW]

CC Email

channel_partner_code[RW]

The code of the channel partner

channel_partner_order_id[RW]

The order ID assigned by the channel partner for this order

city[RW]

City

company[RW]

Company

country_code[RW]

ISO-3166 two letter country code

creation_date_begin[RW]

Date/time that the order was created

creation_date_end[RW]

Date/time that the order was created

current_stage[RW]

Current stage that the order is in.

custom_field_1[RW]

Custom field 1

custom_field_2[RW]

Custom field 2

custom_field_3[RW]

Custom field 3

custom_field_4[RW]

Custom field 4

custom_field_5[RW]

Custom field 5

custom_field_6[RW]

Custom field 6

custom_field_7[RW]

Custom field 7

customer_profile_oid[RW]

The customer profile to find associated orders for

email[RW]

Email

first_name[RW]

First name

item_id[RW]

Item ID

last_name[RW]

Last name

order_id[RW]

Order ID

payment_date_begin[RW]

Date/time that the order was successfully processed

payment_date_end[RW]

Date/time that the order was successfully processed

payment_method[RW]

Payment method

phone[RW]

Phone

postal_code[RW]

Postal code

purchase_order_number[RW]

Purchase order number

refund_date_begin[RW]

Date/time that the order was refunded

refund_date_end[RW]

Date/time that the order was refunded

rma[RW]

RMA number

screen_branding_theme_code[RW]

Screen branding theme code associated with the order (legacy checkout)

shipment_date_begin[RW]

Date/time that the order was shipped

shipment_date_end[RW]

Date/time that the order was shipped

shipped_on_date_begin[RW]

Date/time that the order should ship on

shipped_on_date_end[RW]

Date/time that the order should ship on

state_region[RW]

State for United States otherwise region or province for other countries

storefront_host_name[RW]

StoreFront host name associated with the order

total[RW]

Total

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/ultracart_api/models/order_query.rb, line 157
def self.attribute_map
  {
    :'cc_email' => :'cc_email',
    :'channel_partner_code' => :'channel_partner_code',
    :'channel_partner_order_id' => :'channel_partner_order_id',
    :'city' => :'city',
    :'company' => :'company',
    :'country_code' => :'country_code',
    :'creation_date_begin' => :'creation_date_begin',
    :'creation_date_end' => :'creation_date_end',
    :'current_stage' => :'current_stage',
    :'custom_field_1' => :'custom_field_1',
    :'custom_field_2' => :'custom_field_2',
    :'custom_field_3' => :'custom_field_3',
    :'custom_field_4' => :'custom_field_4',
    :'custom_field_5' => :'custom_field_5',
    :'custom_field_6' => :'custom_field_6',
    :'custom_field_7' => :'custom_field_7',
    :'customer_profile_oid' => :'customer_profile_oid',
    :'email' => :'email',
    :'first_name' => :'first_name',
    :'item_id' => :'item_id',
    :'last_name' => :'last_name',
    :'order_id' => :'order_id',
    :'payment_date_begin' => :'payment_date_begin',
    :'payment_date_end' => :'payment_date_end',
    :'payment_method' => :'payment_method',
    :'phone' => :'phone',
    :'postal_code' => :'postal_code',
    :'purchase_order_number' => :'purchase_order_number',
    :'refund_date_begin' => :'refund_date_begin',
    :'refund_date_end' => :'refund_date_end',
    :'rma' => :'rma',
    :'screen_branding_theme_code' => :'screen_branding_theme_code',
    :'shipment_date_begin' => :'shipment_date_begin',
    :'shipment_date_end' => :'shipment_date_end',
    :'shipped_on_date_begin' => :'shipped_on_date_begin',
    :'shipped_on_date_end' => :'shipped_on_date_end',
    :'state_region' => :'state_region',
    :'storefront_host_name' => :'storefront_host_name',
    :'total' => :'total'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/ultracart_api/models/order_query.rb, line 248
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'cc_email')
    self.cc_email = attributes[:'cc_email']
  end

  if attributes.has_key?(:'channel_partner_code')
    self.channel_partner_code = attributes[:'channel_partner_code']
  end

  if attributes.has_key?(:'channel_partner_order_id')
    self.channel_partner_order_id = attributes[:'channel_partner_order_id']
  end

  if attributes.has_key?(:'city')
    self.city = attributes[:'city']
  end

  if attributes.has_key?(:'company')
    self.company = attributes[:'company']
  end

  if attributes.has_key?(:'country_code')
    self.country_code = attributes[:'country_code']
  end

  if attributes.has_key?(:'creation_date_begin')
    self.creation_date_begin = attributes[:'creation_date_begin']
  end

  if attributes.has_key?(:'creation_date_end')
    self.creation_date_end = attributes[:'creation_date_end']
  end

  if attributes.has_key?(:'current_stage')
    self.current_stage = attributes[:'current_stage']
  end

  if attributes.has_key?(:'custom_field_1')
    self.custom_field_1 = attributes[:'custom_field_1']
  end

  if attributes.has_key?(:'custom_field_2')
    self.custom_field_2 = attributes[:'custom_field_2']
  end

  if attributes.has_key?(:'custom_field_3')
    self.custom_field_3 = attributes[:'custom_field_3']
  end

  if attributes.has_key?(:'custom_field_4')
    self.custom_field_4 = attributes[:'custom_field_4']
  end

  if attributes.has_key?(:'custom_field_5')
    self.custom_field_5 = attributes[:'custom_field_5']
  end

  if attributes.has_key?(:'custom_field_6')
    self.custom_field_6 = attributes[:'custom_field_6']
  end

  if attributes.has_key?(:'custom_field_7')
    self.custom_field_7 = attributes[:'custom_field_7']
  end

  if attributes.has_key?(:'customer_profile_oid')
    self.customer_profile_oid = attributes[:'customer_profile_oid']
  end

  if attributes.has_key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.has_key?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.has_key?(:'item_id')
    self.item_id = attributes[:'item_id']
  end

  if attributes.has_key?(:'last_name')
    self.last_name = attributes[:'last_name']
  end

  if attributes.has_key?(:'order_id')
    self.order_id = attributes[:'order_id']
  end

  if attributes.has_key?(:'payment_date_begin')
    self.payment_date_begin = attributes[:'payment_date_begin']
  end

  if attributes.has_key?(:'payment_date_end')
    self.payment_date_end = attributes[:'payment_date_end']
  end

  if attributes.has_key?(:'payment_method')
    self.payment_method = attributes[:'payment_method']
  end

  if attributes.has_key?(:'phone')
    self.phone = attributes[:'phone']
  end

  if attributes.has_key?(:'postal_code')
    self.postal_code = attributes[:'postal_code']
  end

  if attributes.has_key?(:'purchase_order_number')
    self.purchase_order_number = attributes[:'purchase_order_number']
  end

  if attributes.has_key?(:'refund_date_begin')
    self.refund_date_begin = attributes[:'refund_date_begin']
  end

  if attributes.has_key?(:'refund_date_end')
    self.refund_date_end = attributes[:'refund_date_end']
  end

  if attributes.has_key?(:'rma')
    self.rma = attributes[:'rma']
  end

  if attributes.has_key?(:'screen_branding_theme_code')
    self.screen_branding_theme_code = attributes[:'screen_branding_theme_code']
  end

  if attributes.has_key?(:'shipment_date_begin')
    self.shipment_date_begin = attributes[:'shipment_date_begin']
  end

  if attributes.has_key?(:'shipment_date_end')
    self.shipment_date_end = attributes[:'shipment_date_end']
  end

  if attributes.has_key?(:'shipped_on_date_begin')
    self.shipped_on_date_begin = attributes[:'shipped_on_date_begin']
  end

  if attributes.has_key?(:'shipped_on_date_end')
    self.shipped_on_date_end = attributes[:'shipped_on_date_end']
  end

  if attributes.has_key?(:'state_region')
    self.state_region = attributes[:'state_region']
  end

  if attributes.has_key?(:'storefront_host_name')
    self.storefront_host_name = attributes[:'storefront_host_name']
  end

  if attributes.has_key?(:'total')
    self.total = attributes[:'total']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/ultracart_api/models/order_query.rb, line 202
def self.swagger_types
  {
    :'cc_email' => :'String',
    :'channel_partner_code' => :'String',
    :'channel_partner_order_id' => :'String',
    :'city' => :'String',
    :'company' => :'String',
    :'country_code' => :'String',
    :'creation_date_begin' => :'String',
    :'creation_date_end' => :'String',
    :'current_stage' => :'String',
    :'custom_field_1' => :'String',
    :'custom_field_2' => :'String',
    :'custom_field_3' => :'String',
    :'custom_field_4' => :'String',
    :'custom_field_5' => :'String',
    :'custom_field_6' => :'String',
    :'custom_field_7' => :'String',
    :'customer_profile_oid' => :'Integer',
    :'email' => :'String',
    :'first_name' => :'String',
    :'item_id' => :'String',
    :'last_name' => :'String',
    :'order_id' => :'String',
    :'payment_date_begin' => :'String',
    :'payment_date_end' => :'String',
    :'payment_method' => :'String',
    :'phone' => :'String',
    :'postal_code' => :'String',
    :'purchase_order_number' => :'String',
    :'refund_date_begin' => :'String',
    :'refund_date_end' => :'String',
    :'rma' => :'String',
    :'screen_branding_theme_code' => :'String',
    :'shipment_date_begin' => :'String',
    :'shipment_date_end' => :'String',
    :'shipped_on_date_begin' => :'String',
    :'shipped_on_date_end' => :'String',
    :'state_region' => :'String',
    :'storefront_host_name' => :'String',
    :'total' => :'Float'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/ultracart_api/models/order_query.rb, line 630
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cc_email == o.cc_email &&
      channel_partner_code == o.channel_partner_code &&
      channel_partner_order_id == o.channel_partner_order_id &&
      city == o.city &&
      company == o.company &&
      country_code == o.country_code &&
      creation_date_begin == o.creation_date_begin &&
      creation_date_end == o.creation_date_end &&
      current_stage == o.current_stage &&
      custom_field_1 == o.custom_field_1 &&
      custom_field_2 == o.custom_field_2 &&
      custom_field_3 == o.custom_field_3 &&
      custom_field_4 == o.custom_field_4 &&
      custom_field_5 == o.custom_field_5 &&
      custom_field_6 == o.custom_field_6 &&
      custom_field_7 == o.custom_field_7 &&
      customer_profile_oid == o.customer_profile_oid &&
      email == o.email &&
      first_name == o.first_name &&
      item_id == o.item_id &&
      last_name == o.last_name &&
      order_id == o.order_id &&
      payment_date_begin == o.payment_date_begin &&
      payment_date_end == o.payment_date_end &&
      payment_method == o.payment_method &&
      phone == o.phone &&
      postal_code == o.postal_code &&
      purchase_order_number == o.purchase_order_number &&
      refund_date_begin == o.refund_date_begin &&
      refund_date_end == o.refund_date_end &&
      rma == o.rma &&
      screen_branding_theme_code == o.screen_branding_theme_code &&
      shipment_date_begin == o.shipment_date_begin &&
      shipment_date_end == o.shipment_date_end &&
      shipped_on_date_begin == o.shipped_on_date_begin &&
      shipped_on_date_end == o.shipped_on_date_end &&
      state_region == o.state_region &&
      storefront_host_name == o.storefront_host_name &&
      total == o.total
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/ultracart_api/models/order_query.rb, line 710
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 = UltracartClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

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/ultracart_api/models/order_query.rb, line 776
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
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/ultracart_api/models/order_query.rb, line 689
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that 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
cc_email=(cc_email) click to toggle source

Custom attribute writer method with validation @param [Object] cc_email Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 490
def cc_email=(cc_email)
  if !cc_email.nil? && cc_email.to_s.length > 100
    fail ArgumentError, 'invalid value for "cc_email", the character length must be smaller than or equal to 100.'
  end

  @cc_email = cc_email
end
city=(city) click to toggle source

Custom attribute writer method with validation @param [Object] city Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 500
def city=(city)
  if !city.nil? && city.to_s.length > 32
    fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 32.'
  end

  @city = city
end
company=(company) click to toggle source

Custom attribute writer method with validation @param [Object] company Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 510
def company=(company)
  if !company.nil? && company.to_s.length > 50
    fail ArgumentError, 'invalid value for "company", the character length must be smaller than or equal to 50.'
  end

  @company = company
end
country_code=(country_code) click to toggle source

Custom attribute writer method with validation @param [Object] country_code Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 520
def country_code=(country_code)
  if !country_code.nil? && country_code.to_s.length > 2
    fail ArgumentError, 'invalid value for "country_code", the character length must be smaller than or equal to 2.'
  end

  @country_code = country_code
end
current_stage=(current_stage) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] current_stage Object to be assigned

# File lib/ultracart_api/models/order_query.rb, line 530
def current_stage=(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'])
  unless validator.valid?(current_stage)
    fail ArgumentError, 'invalid value for "current_stage", must be one of #{validator.allowable_values}.'
  end
  @current_stage = current_stage
end
email=(email) click to toggle source

Custom attribute writer method with validation @param [Object] email Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 540
def email=(email)
  if !email.nil? && email.to_s.length > 100
    fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 100.'
  end

  @email = email
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/ultracart_api/models/order_query.rb, line 676
def eql?(o)
  self == o
end
first_name=(first_name) click to toggle source

Custom attribute writer method with validation @param [Object] first_name Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 550
def first_name=(first_name)
  if !first_name.nil? && first_name.to_s.length > 30
    fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 30.'
  end

  @first_name = first_name
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/ultracart_api/models/order_query.rb, line 682
def hash
  [cc_email, channel_partner_code, channel_partner_order_id, city, company, country_code, creation_date_begin, creation_date_end, current_stage, custom_field_1, custom_field_2, custom_field_3, custom_field_4, custom_field_5, custom_field_6, custom_field_7, customer_profile_oid, email, first_name, item_id, last_name, order_id, payment_date_begin, payment_date_end, payment_method, phone, postal_code, purchase_order_number, refund_date_begin, refund_date_end, rma, screen_branding_theme_code, shipment_date_begin, shipment_date_end, shipped_on_date_begin, shipped_on_date_end, state_region, storefront_host_name, total].hash
end
last_name=(last_name) click to toggle source

Custom attribute writer method with validation @param [Object] last_name Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 560
def last_name=(last_name)
  if !last_name.nil? && last_name.to_s.length > 30
    fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 30.'
  end

  @last_name = last_name
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/ultracart_api/models/order_query.rb, line 413
def list_invalid_properties
  invalid_properties = Array.new
  if !@cc_email.nil? && @cc_email.to_s.length > 100
    invalid_properties.push('invalid value for "cc_email", the character length must be smaller than or equal to 100.')
  end

  if !@city.nil? && @city.to_s.length > 32
    invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 32.')
  end

  if !@company.nil? && @company.to_s.length > 50
    invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 50.')
  end

  if !@country_code.nil? && @country_code.to_s.length > 2
    invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 2.')
  end

  if !@email.nil? && @email.to_s.length > 100
    invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 100.')
  end

  if !@first_name.nil? && @first_name.to_s.length > 30
    invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 30.')
  end

  if !@last_name.nil? && @last_name.to_s.length > 30
    invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 30.')
  end

  if !@phone.nil? && @phone.to_s.length > 25
    invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 25.')
  end

  if !@postal_code.nil? && @postal_code.to_s.length > 20
    invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 20.')
  end

  if !@rma.nil? && @rma.to_s.length > 30
    invalid_properties.push('invalid value for "rma", the character length must be smaller than or equal to 30.')
  end

  if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
    invalid_properties.push('invalid value for "screen_branding_theme_code", the character length must be smaller than or equal to 10.')
  end

  if !@state_region.nil? && @state_region.to_s.length > 32
    invalid_properties.push('invalid value for "state_region", the character length must be smaller than or equal to 32.')
  end

  invalid_properties
end
payment_method=(payment_method) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method Object to be assigned

# File lib/ultracart_api/models/order_query.rb, line 570
def payment_method=(payment_method)
  validator = EnumAttributeValidator.new('String', ['Affirm', 'Amazon', 'Amazon SC', 'Cash', 'Check', 'COD', 'Credit Card', 'eCheck', 'Google Shopping', 'LoanHero', 'Money Order', 'PayPal', 'Purchase Order', 'Quote Request', 'Unknown', 'Wire Transfer'])
  unless validator.valid?(payment_method)
    fail ArgumentError, 'invalid value for "payment_method", must be one of #{validator.allowable_values}.'
  end
  @payment_method = payment_method
end
phone=(phone) click to toggle source

Custom attribute writer method with validation @param [Object] phone Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 580
def phone=(phone)
  if !phone.nil? && phone.to_s.length > 25
    fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 25.'
  end

  @phone = phone
end
postal_code=(postal_code) click to toggle source

Custom attribute writer method with validation @param [Object] postal_code Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 590
def postal_code=(postal_code)
  if !postal_code.nil? && postal_code.to_s.length > 20
    fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 20.'
  end

  @postal_code = postal_code
end
rma=(rma) click to toggle source

Custom attribute writer method with validation @param [Object] rma Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 600
def rma=(rma)
  if !rma.nil? && rma.to_s.length > 30
    fail ArgumentError, 'invalid value for "rma", the character length must be smaller than or equal to 30.'
  end

  @rma = rma
end
screen_branding_theme_code=(screen_branding_theme_code) click to toggle source

Custom attribute writer method with validation @param [Object] screen_branding_theme_code Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 610
def screen_branding_theme_code=(screen_branding_theme_code)
  if !screen_branding_theme_code.nil? && screen_branding_theme_code.to_s.length > 10
    fail ArgumentError, 'invalid value for "screen_branding_theme_code", the character length must be smaller than or equal to 10.'
  end

  @screen_branding_theme_code = screen_branding_theme_code
end
state_region=(state_region) click to toggle source

Custom attribute writer method with validation @param [Object] state_region Value to be assigned

# File lib/ultracart_api/models/order_query.rb, line 620
def state_region=(state_region)
  if !state_region.nil? && state_region.to_s.length > 32
    fail ArgumentError, 'invalid value for "state_region", the character length must be smaller than or equal to 32.'
  end

  @state_region = state_region
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/ultracart_api/models/order_query.rb, line 756
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/ultracart_api/models/order_query.rb, line 762
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
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/ultracart_api/models/order_query.rb, line 750
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/ultracart_api/models/order_query.rb, line 468
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', 'Google Shopping', 'LoanHero', 'Money Order', 'PayPal', 'Purchase Order', 'Quote Request', 'Unknown', 'Wire Transfer'])
  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
  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