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.



25007
25008
25009
25010
25011
25012
25013
25014
25015
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25007

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::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.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)))
end

Instance Attribute Details

#experienceObject (readonly)

Returns the value of attribute experience.



25005
25006
25007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25005

def experience
  @experience
end

#itemObject (readonly)

Returns the value of attribute item.



25005
25006
25007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25005

def item
  @item
end

#organizationObject (readonly)

Returns the value of attribute organization.



25005
25006
25007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25005

def organization
  @organization
end

#pricesObject (readonly)

Returns the value of attribute prices.



25005
25006
25007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25005

def prices
  @prices
end

#statusObject (readonly)

Returns the value of attribute status.



25005
25006
25007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25005

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25021
25022
25023
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25021

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

#to_hashObject



25025
25026
25027
25028
25029
25030
25031
25032
25033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25025

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
  }
end

#to_jsonObject



25017
25018
25019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25017

def to_json
  JSON.dump(to_hash)
end