Class: Io::Flow::V0::Models::PriceBookItemExportType

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

Overview

Defines the filters that can be applied when requesting a price book item data export

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 = {}) ⇒ PriceBookItemExportType

Returns a new instance of PriceBookItemExportType.



60050
60051
60052
60053
60054
60055
60056
60057
60058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60050

def initialize(incoming={})
  super(:discriminator => ExportType::Types::PRICE_BOOK_ITEM_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @price_book_key = (x = opts.delete(:price_book_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('price_book_key', x, String))
  @item_numbers = (x = opts.delete(:item_numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('item_numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('item_numbers', v, String) })
  @start_date = (x = opts.delete(:start_date); x.nil? ? nil : HttpClient::Preconditions.assert_class('start_date', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @end_date = (x = opts.delete(:end_date); x.nil? ? nil : HttpClient::Preconditions.assert_class('end_date', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @item_identifier = (x = (x = opts.delete(:item_identifier); x.nil? ? "item_number" : x); x.is_a?(::Io::Flow::V0::Models::ItemIdentifier) ? x : ::Io::Flow::V0::Models::ItemIdentifier.apply(x))
end

Instance Attribute Details

#end_dateObject (readonly)

Returns the value of attribute end_date.



60048
60049
60050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60048

def end_date
  @end_date
end

#item_identifierObject (readonly)

Returns the value of attribute item_identifier.



60048
60049
60050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60048

def item_identifier
  @item_identifier
end

#item_numbersObject (readonly)

Returns the value of attribute item_numbers.



60048
60049
60050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60048

def item_numbers
  @item_numbers
end

#price_book_keyObject (readonly)

Returns the value of attribute price_book_key.



60048
60049
60050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60048

def price_book_key
  @price_book_key
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



60048
60049
60050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60048

def start_date
  @start_date
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



60064
60065
60066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60064

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

#subtype_to_hashObject



60068
60069
60070
60071
60072
60073
60074
60075
60076
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60068

def subtype_to_hash
  {
    :price_book_key => price_book_key,
    :item_numbers => item_numbers.nil? ? nil : item_numbers,
    :start_date => start_date,
    :end_date => end_date,
    :item_identifier => item_identifier.value
  }
end

#to_jsonObject



60060
60061
60062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60060

def to_json
  JSON.dump(to_hash)
end