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.



55458
55459
55460
55461
55462
55463
55464
55465
55466
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55458

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.



55456
55457
55458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55456

def end_date
  @end_date
end

#item_identifierObject (readonly)

Returns the value of attribute item_identifier.



55456
55457
55458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55456

def item_identifier
  @item_identifier
end

#item_numbersObject (readonly)

Returns the value of attribute item_numbers.



55456
55457
55458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55456

def item_numbers
  @item_numbers
end

#price_book_keyObject (readonly)

Returns the value of attribute price_book_key.



55456
55457
55458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55456

def price_book_key
  @price_book_key
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



55456
55457
55458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55456

def start_date
  @start_date
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55472
55473
55474
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55472

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

#subtype_to_hashObject



55476
55477
55478
55479
55480
55481
55482
55483
55484
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55476

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



55468
55469
55470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55468

def to_json
  JSON.dump(to_hash)
end