Class: Io::Flow::V0::Models::SolidusProductExportType

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

Overview

Exports product level data for import into solidus

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

Returns a new instance of SolidusProductExportType.



63633
63634
63635
63636
63637
63638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63633

def initialize(incoming={})
  super(:discriminator => ExportType::Types::SOLIDUS_PRODUCT_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) })
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
end

Instance Attribute Details

#numbersObject (readonly)

Returns the value of attribute numbers.



63631
63632
63633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63631

def numbers
  @numbers
end

#sortObject (readonly)

Returns the value of attribute sort.



63631
63632
63633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63631

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



63644
63645
63646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63644

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

#subtype_to_hashObject



63648
63649
63650
63651
63652
63653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63648

def subtype_to_hash
  {
    :numbers => numbers.nil? ? nil : numbers,
    :sort => sort
  }
end

#to_jsonObject



63640
63641
63642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63640

def to_json
  JSON.dump(to_hash)
end