Class: Io::Flow::V0::Models::ExportLocalizedItemPrices

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ExportLocalizedItemPrices

Returns a new instance of ExportLocalizedItemPrices.



42914
42915
42916
42917
42918
42919
42920
42921
42922
42923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42914

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:organization, :experience, :item, :prices], 'ExportLocalizedItemPrices')
  @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x))
  @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceSummary) ? x : ::Io::Flow::V0::Models::ExperienceSummary.new(x))
  @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::CatalogItemReference) ? x : ::Io::Flow::V0::Models::CatalogItemReference.new(x))
  @prices = (x = opts.delete(:prices); x.is_a?(::Io::Flow::V0::Models::ExportLocalizedItemPricesDetail) ? x : ::Io::Flow::V0::Models::ExportLocalizedItemPricesDetail.new(x))
  @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x)))
  @rates = (x = opts.delete(:rates); x.nil? ? nil : HttpClient::Preconditions.assert_class('rates', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Rate) ? x : ::Io::Flow::V0::Models::Rate.new(x)) })
end

Instance Attribute Details

#experienceObject (readonly)

Returns the value of attribute experience.



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def experience
  @experience
end

#itemObject (readonly)

Returns the value of attribute item.



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def item
  @item
end

#organizationObject (readonly)

Returns the value of attribute organization.



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def organization
  @organization
end

#pricesObject (readonly)

Returns the value of attribute prices.



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def prices
  @prices
end

#ratesObject (readonly)

Returns the value of attribute rates.



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def rates
  @rates
end

#statusObject (readonly)

Returns the value of attribute status.



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



42929
42930
42931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42929

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

#to_hashObject



42933
42934
42935
42936
42937
42938
42939
42940
42941
42942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42933

def to_hash
  {
    :organization => organization.to_hash,
    :experience => experience.to_hash,
    :item => item.to_hash,
    :prices => prices.to_hash,
    :status => status.nil? ? nil : status.value,
    :rates => rates.nil? ? nil : rates.map { |o| o.to_hash }
  }
end

#to_jsonObject



42925
42926
42927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42925

def to_json
  JSON.dump(to_hash)
end