class Io::Flow::V0::Models::Subcatalog

A configuration with custom query to select a subset of the catalog items for a localized experience

Attributes

catalog[R]
id[R]
settings[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68917
def initialize(incoming={})
  super(:discriminator => ExpandableSubcatalog::Types::SUBCATALOG)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :catalog, :settings], 'Subcatalog')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @catalog = (x = opts.delete(:catalog); x.is_a?(::Io::Flow::V0::Models::Catalog) ? x : ::Io::Flow::V0::Models::Catalog.new(x))
  @settings = (x = opts.delete(:settings); x.is_a?(::Io::Flow::V0::Models::SubcatalogSettings) ? x : ::Io::Flow::V0::Models::SubcatalogSettings.new(x))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68930
def copy(incoming={})
  Subcatalog.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68934
def subtype_to_hash
  {
    :id => id,
    :catalog => catalog.to_hash,
    :settings => settings.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68926
def to_json
  JSON.dump(to_hash)
end