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.



424
425
426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 424

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.



429
430
431
432
433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 429

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.



436
437
438
439
440
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 436

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