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



18918
18919
18920
18921
18922
18923
18924
18925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18918

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

Instance Attribute Details

#experienceObject (readonly)

Returns the value of attribute experience.



18916
18917
18918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18916

def experience
  @experience
end

#itemObject (readonly)

Returns the value of attribute item.



18916
18917
18918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18916

def item
  @item
end

#organizationObject (readonly)

Returns the value of attribute organization.



18916
18917
18918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18916

def organization
  @organization
end

#pricesObject (readonly)

Returns the value of attribute prices.



18916
18917
18918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18916

def prices
  @prices
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18931
18932
18933
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18931

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

#to_hashObject



18935
18936
18937
18938
18939
18940
18941
18942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18935

def to_hash
  {
    :organization => organization.to_hash,
    :experience => experience.to_hash,
    :item => item.to_hash,
    :prices => prices.to_hash
  }
end

#to_jsonObject



18927
18928
18929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18927

def to_json
  JSON.dump(to_hash)
end