Class: Io::Flow::V0::Clients::Catalogs

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Catalogs

Returns a new instance of Catalogs.



396
397
398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 396

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#get_catalog(organization) ⇒ Object

Returns information about a specific catalog.



401
402
403
404
405
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 401

def get_catalog(organization)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  r = @client.request("/#{CGI.escape(organization)}/catalog").get
  ::Io::Flow::V0::Models::Catalog.new(r)
end

#get_catalog_and_statistics(organization) ⇒ Object

Get statistics for this organization’s catalog.



408
409
410
411
412
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 408

def get_catalog_and_statistics(organization)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  r = @client.request("/#{CGI.escape(organization)}/catalog/statistics").get
  ::Io::Flow::V0::Models::CatalogStatistics.new(r)
end