Class: Io::Flow::V0::Models::OrderExportType

Inherits:
ExportType
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Exports orders

Instance Attribute Summary collapse

Attributes inherited from ExportType

#discriminator

Instance Method Summary collapse

Methods inherited from ExportType

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrderExportType

Returns a new instance of OrderExportType.



51866
51867
51868
51869
51870
51871
51872
51873
51874
51875
51876
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51866

def initialize(incoming={})
  super(:discriminator => ExportType::Types::ORDER_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
   = (x = opts.delete(:min_hours_since_submitted_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('min_hours_since_submitted_at', x, Integer))
  @submitted_on_or_before = (x = opts.delete(:submitted_on_or_before); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_on_or_before', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @submitted_on_or_after = (x = opts.delete(:submitted_on_or_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_on_or_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderStatus) ? x : ::Io::Flow::V0::Models::OrderStatus.apply(x)))
  @has_tracking_label = (x = opts.delete(:has_tracking_label); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_tracking_label', x))
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
end

Instance Attribute Details

#has_tracking_labelObject (readonly)

Returns the value of attribute has_tracking_label.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def has_tracking_label
  @has_tracking_label
end

#min_hours_since_submitted_atObject (readonly)

Returns the value of attribute min_hours_since_submitted_at.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def 
  
end

#numbersObject (readonly)

Returns the value of attribute numbers.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def numbers
  @numbers
end

#sortObject (readonly)

Returns the value of attribute sort.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def sort
  @sort
end

#statusObject (readonly)

Returns the value of attribute status.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def status
  @status
end

#submitted_on_or_afterObject (readonly)

Returns the value of attribute submitted_on_or_after.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def 
  @submitted_on_or_after
end

#submitted_on_or_beforeObject (readonly)

Returns the value of attribute submitted_on_or_before.



51864
51865
51866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51864

def 
  @submitted_on_or_before
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51882
51883
51884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51882

def copy(incoming={})
  OrderExportType.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



51886
51887
51888
51889
51890
51891
51892
51893
51894
51895
51896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51886

def subtype_to_hash
  {
    :numbers => numbers.nil? ? nil : numbers,
    :min_hours_since_submitted_at => ,
    :submitted_on_or_before => ,
    :submitted_on_or_after => ,
    :status => status.nil? ? nil : status.value,
    :has_tracking_label => has_tracking_label,
    :sort => sort
  }
end

#to_jsonObject



51878
51879
51880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51878

def to_json
  JSON.dump(to_hash)
end