flowcommerce 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca499ee693efdc71a8cead7daf2d54c6b964eaf8
4
- data.tar.gz: 3f4de27a4edbc09df06c2c4340385e51afa97ec8
3
+ metadata.gz: 1cfa65a9bf67ec6615f71dab03639fa4aa448f8b
4
+ data.tar.gz: 385346b70cfb4a10050572139ce61e0d8fa59753
5
5
  SHA512:
6
- metadata.gz: e9df3b57af4a45821c74e51e20e95f73531350db1b850a175bf2542c3c64d590d3fa287902d6d898ec8194dd30ff371089829a612311b89f72b55690dbe2deea
7
- data.tar.gz: ab2c3588cbc691ef24ad8004de19312ddd4af3f6fb5740ad47a985ad4e019511b8fb48b3b316221a5aaef20f6e95e8355ca04886d0f0ce8508f1b185382e0a19
6
+ metadata.gz: 4c747fa5afe81b6238d3bc546c433bb6f4c17d464cb9f411b43f32350c258556642aa3837e16ec19fe37437d8ef4214e9cb96bfa68fb0534dd0c1750d16c2e92
7
+ data.tar.gz: 1b012bd86c20def9b4d873a5401f4725b584bdd68c5281189dedfe9ffaac3758b3dea6c2786f157716ac39f8b49d9007981c0974b200e925377827a1824c6e45
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.0.65
3
- # apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.65/ruby_client
2
+ # Service version: 0.0.67
3
+ # apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.67/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,8 +25,8 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.65/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.0.65' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.67/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.0.67' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -865,6 +865,14 @@ module Io
865
865
  nil
866
866
  end
867
867
 
868
+ # Get statistics for the specified subcatalog. Always paginated.
869
+ def get_statistics_by_subcatalog_id(organization, subcatalog_id)
870
+ HttpClient::Preconditions.assert_class('organization', organization, String)
871
+ HttpClient::Preconditions.assert_class('subcatalog_id', subcatalog_id, String)
872
+ r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog_id)}/statistics").get
873
+ ::Io::Flow::V0::Models::SubcatalogStatistics.new(r)
874
+ end
875
+
868
876
  # Provides visibility into recent changes of each object, including deletion
869
877
  def get_versions(organization, incoming={})
870
878
  HttpClient::Preconditions.assert_class('organization', organization, String)
@@ -943,7 +951,6 @@ module Io
943
951
  opts = HttpClient::Helper.symbolize_keys(incoming)
944
952
  query = {
945
953
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
946
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
947
954
  :subcatalog => (x = opts.delete(:subcatalog); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog', x, String)),
948
955
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
949
956
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
@@ -962,27 +969,18 @@ module Io
962
969
  end
963
970
 
964
971
  # Returns information about a specific function.
965
- def get_by_key(organization, key)
966
- HttpClient::Preconditions.assert_class('organization', organization, String)
967
- HttpClient::Preconditions.assert_class('key', key, String)
968
- r = @client.request("/#{CGI.escape(organization)}/functions/#{CGI.escape(key)}").get
969
- ::Io::Flow::V0::Models::Function.new(r)
970
- end
971
-
972
- # Update function with the specified key, creating if it does not exist.
973
- def put_by_key(organization, key, function_form)
972
+ def get_by_id(organization, id)
974
973
  HttpClient::Preconditions.assert_class('organization', organization, String)
975
- HttpClient::Preconditions.assert_class('key', key, String)
976
- HttpClient::Preconditions.assert_class('function_form', function_form, ::Io::Flow::V0::Models::FunctionForm)
977
- r = @client.request("/#{CGI.escape(organization)}/functions/#{CGI.escape(key)}").with_json(function_form.to_json).put
974
+ HttpClient::Preconditions.assert_class('id', id, String)
975
+ r = @client.request("/#{CGI.escape(organization)}/functions/#{CGI.escape(id)}").get
978
976
  ::Io::Flow::V0::Models::Function.new(r)
979
977
  end
980
978
 
981
- # Delete the function with this key
982
- def delete_by_key(organization, key)
979
+ # Delete the function with this id
980
+ def delete_by_id(organization, id)
983
981
  HttpClient::Preconditions.assert_class('organization', organization, String)
984
- HttpClient::Preconditions.assert_class('key', key, String)
985
- r = @client.request("/#{CGI.escape(organization)}/functions/#{CGI.escape(key)}").delete
982
+ HttpClient::Preconditions.assert_class('id', id, String)
983
+ r = @client.request("/#{CGI.escape(organization)}/functions/#{CGI.escape(id)}").delete
986
984
  nil
987
985
  end
988
986
 
@@ -992,8 +990,6 @@ module Io
992
990
  opts = HttpClient::Helper.symbolize_keys(incoming)
993
991
  query = {
994
992
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
995
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
996
- :name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
997
993
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
998
994
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
999
995
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
@@ -1860,7 +1856,7 @@ module Io
1860
1856
  query = {
1861
1857
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1862
1858
  :center => (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, Array).map { |v| HttpClient::Preconditions.assert_class('center', v, String) }),
1863
- :item => (x = opts.delete(:item); x.nil? ? nil : HttpClient::Preconditions.assert_class('item', x, Array).map { |v| HttpClient::Preconditions.assert_class('item', v, String) }),
1859
+ :item_number => (x = opts.delete(:item_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('item_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('item_number', v, String) }),
1864
1860
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1865
1861
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1866
1862
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
@@ -1904,7 +1900,7 @@ module Io
1904
1900
  query = {
1905
1901
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1906
1902
  :center => (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, Array).map { |v| HttpClient::Preconditions.assert_class('center', v, String) }),
1907
- :item => (x = opts.delete(:item); x.nil? ? nil : HttpClient::Preconditions.assert_class('item', x, Array).map { |v| HttpClient::Preconditions.assert_class('item', v, String) }),
1903
+ :item_number => (x = opts.delete(:item_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('item_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('item_number', v, String) }),
1908
1904
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1909
1905
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1910
1906
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
@@ -6305,6 +6301,36 @@ module Io
6305
6301
 
6306
6302
  end
6307
6303
 
6304
+ # Statistics covering product catalog item information, including total catalog
6305
+ # item count, number of distinct categories, etc.
6306
+ class CatalogStatistics
6307
+
6308
+ attr_reader :number_items, :number_categories
6309
+
6310
+ def initialize(incoming={})
6311
+ opts = HttpClient::Helper.symbolize_keys(incoming)
6312
+ HttpClient::Preconditions.require_keys(opts, [:number_items, :number_categories], 'CatalogStatistics')
6313
+ @number_items = HttpClient::Preconditions.assert_class('number_items', opts.delete(:number_items), Integer)
6314
+ @number_categories = HttpClient::Preconditions.assert_class('number_categories', opts.delete(:number_categories), Integer)
6315
+ end
6316
+
6317
+ def to_json
6318
+ JSON.dump(to_hash)
6319
+ end
6320
+
6321
+ def copy(incoming={})
6322
+ CatalogStatistics.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6323
+ end
6324
+
6325
+ def to_hash
6326
+ {
6327
+ :number_items => number_items,
6328
+ :number_categories => number_categories
6329
+ }
6330
+ end
6331
+
6332
+ end
6333
+
6308
6334
  class CatalogVersion
6309
6335
 
6310
6336
  attr_reader :id, :timestamp, :type, :catalog
@@ -7678,20 +7704,20 @@ module Io
7678
7704
  # functions if needed.
7679
7705
  class Function < ExpandableFunction
7680
7706
 
7681
- attr_reader :id, :subcatalog_id, :key, :name, :position, :presets, :code, :q
7707
+ attr_reader :id, :subcatalog_id, :name, :position, :adjustments, :levies, :code, :q
7682
7708
 
7683
7709
  def initialize(incoming={})
7684
7710
  super(:name => ExpandableFunction::Types::FUNCTION)
7685
7711
  opts = HttpClient::Helper.symbolize_keys(incoming)
7686
- HttpClient::Preconditions.require_keys(opts, [:id, :subcatalog_id, :key, :name, :position, :presets, :code], 'Function')
7712
+ HttpClient::Preconditions.require_keys(opts, [:id, :subcatalog_id, :name, :position, :adjustments, :levies, :code, :q], 'Function')
7687
7713
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
7688
7714
  @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
7689
- @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
7690
7715
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7691
7716
  @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
7692
- @presets = (x = opts.delete(:presets); x.is_a?(::Io::Flow::V0::Models::Presets) ? x : ::Io::Flow::V0::Models::Presets.new(x))
7717
+ @adjustments = HttpClient::Preconditions.assert_class('adjustments', opts.delete(:adjustments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Adjustment) ? x : ::Io::Flow::V0::Models::Adjustment.from_json(x)) }
7718
+ @levies = HttpClient::Preconditions.assert_class('levies', opts.delete(:levies), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) }
7693
7719
  @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String)
7694
- @q = (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
7720
+ @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
7695
7721
  end
7696
7722
 
7697
7723
  def to_json
@@ -7706,10 +7732,10 @@ module Io
7706
7732
  {
7707
7733
  :id => id,
7708
7734
  :subcatalog_id => subcatalog_id,
7709
- :key => key,
7710
7735
  :name => name,
7711
7736
  :position => position,
7712
- :presets => presets.to_hash,
7737
+ :adjustments => adjustments.map { |o| o.to_hash },
7738
+ :levies => levies.map { |o| o.value },
7713
7739
  :code => code,
7714
7740
  :q => q
7715
7741
  }
@@ -7728,17 +7754,18 @@ module Io
7728
7754
  # functions if needed.
7729
7755
  class FunctionForm
7730
7756
 
7731
- attr_reader :name, :subcatalog_id, :q, :presets, :code, :position
7757
+ attr_reader :name, :subcatalog_id, :q, :adjustments, :levies, :code, :position
7732
7758
 
7733
7759
  def initialize(incoming={})
7734
7760
  opts = HttpClient::Helper.symbolize_keys(incoming)
7735
- HttpClient::Preconditions.require_keys(opts, [:name, :subcatalog_id, :position], 'FunctionForm')
7761
+ HttpClient::Preconditions.require_keys(opts, [:name, :subcatalog_id], 'FunctionForm')
7736
7762
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
7737
7763
  @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
7738
7764
  @q = (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
7739
- @presets = (x = opts.delete(:presets); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Presets) ? x : ::Io::Flow::V0::Models::Presets.new(x)))
7765
+ @adjustments = (x = opts.delete(:adjustments); x.nil? ? nil : HttpClient::Preconditions.assert_class('adjustments', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Adjustment) ? x : ::Io::Flow::V0::Models::Adjustment.from_json(x)) })
7766
+ @levies = (x = opts.delete(:levies); x.nil? ? nil : HttpClient::Preconditions.assert_class('levies', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) })
7740
7767
  @code = (x = opts.delete(:code); x.nil? ? nil : HttpClient::Preconditions.assert_class('code', x, String))
7741
- @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
7768
+ @position = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer))
7742
7769
  end
7743
7770
 
7744
7771
  def to_json
@@ -7754,7 +7781,8 @@ module Io
7754
7781
  :name => name,
7755
7782
  :subcatalog_id => subcatalog_id,
7756
7783
  :q => q,
7757
- :presets => presets.nil? ? nil : presets.to_hash,
7784
+ :adjustments => adjustments.nil? ? nil : adjustments.map { |o| o.to_hash },
7785
+ :levies => levies.nil? ? nil : levies.map { |o| o.value },
7758
7786
  :code => code,
7759
7787
  :position => position
7760
7788
  }
@@ -8856,14 +8884,14 @@ module Io
8856
8884
  # not been previously created, a new row is created for the center/item tuple.
8857
8885
  class InventoryUpdateForm
8858
8886
 
8859
- attr_reader :center, :idempotency_key, :item, :quantity, :type, :notes
8887
+ attr_reader :center, :idempotency_key, :item_number, :quantity, :type, :notes
8860
8888
 
8861
8889
  def initialize(incoming={})
8862
8890
  opts = HttpClient::Helper.symbolize_keys(incoming)
8863
- HttpClient::Preconditions.require_keys(opts, [:center, :idempotency_key, :item, :quantity, :type], 'InventoryUpdateForm')
8891
+ HttpClient::Preconditions.require_keys(opts, [:center, :idempotency_key, :item_number, :quantity, :type], 'InventoryUpdateForm')
8864
8892
  @center = HttpClient::Preconditions.assert_class('center', opts.delete(:center), String)
8865
8893
  @idempotency_key = HttpClient::Preconditions.assert_class('idempotency_key', opts.delete(:idempotency_key), String)
8866
- @item = HttpClient::Preconditions.assert_class('item', opts.delete(:item), String)
8894
+ @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
8867
8895
  @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
8868
8896
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::UpdateType) ? x : ::Io::Flow::V0::Models::UpdateType.apply(x))
8869
8897
  @notes = (x = opts.delete(:notes); x.nil? ? nil : HttpClient::Preconditions.assert_class('notes', HttpClient::Helper.to_object(x), Hash))
@@ -8881,7 +8909,7 @@ module Io
8881
8909
  {
8882
8910
  :center => center,
8883
8911
  :idempotency_key => idempotency_key,
8884
- :item => item,
8912
+ :item_number => item_number,
8885
8913
  :quantity => quantity,
8886
8914
  :type => type.value,
8887
8915
  :notes => notes
@@ -10525,34 +10553,6 @@ module Io
10525
10553
 
10526
10554
  end
10527
10555
 
10528
- # Presentation for UI that is used to generate a localized price function
10529
- class Presets
10530
-
10531
- attr_reader :adjustments, :levies
10532
-
10533
- def initialize(incoming={})
10534
- opts = HttpClient::Helper.symbolize_keys(incoming)
10535
- @adjustments = HttpClient::Preconditions.assert_class('adjustments', (x = opts.delete(:adjustments); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Adjustment) ? x : ::Io::Flow::V0::Models::Adjustment.from_json(x)) }
10536
- @levies = HttpClient::Preconditions.assert_class('levies', (x = opts.delete(:levies); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) }
10537
- end
10538
-
10539
- def to_json
10540
- JSON.dump(to_hash)
10541
- end
10542
-
10543
- def copy(incoming={})
10544
- Presets.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10545
- end
10546
-
10547
- def to_hash
10548
- {
10549
- :adjustments => adjustments.map { |o| o.to_hash },
10550
- :levies => levies.map { |o| o.value }
10551
- }
10552
- end
10553
-
10554
- end
10555
-
10556
10556
  # Represents an amount-currency pair for a basic price
10557
10557
  class Price
10558
10558
 
@@ -11773,6 +11773,42 @@ module Io
11773
11773
 
11774
11774
  end
11775
11775
 
11776
+ # Statistics related to the items in this subcatalog, including item count,
11777
+ # number of distinct categories, etc.
11778
+ class SubcatalogStatistics
11779
+
11780
+ attr_reader :number_items, :number_categories, :number_additions_queued, :number_updates_queued, :catalog
11781
+
11782
+ def initialize(incoming={})
11783
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11784
+ HttpClient::Preconditions.require_keys(opts, [:number_items, :number_categories, :number_additions_queued, :number_updates_queued, :catalog], 'SubcatalogStatistics')
11785
+ @number_items = HttpClient::Preconditions.assert_class('number_items', opts.delete(:number_items), Integer)
11786
+ @number_categories = HttpClient::Preconditions.assert_class('number_categories', opts.delete(:number_categories), Integer)
11787
+ @number_additions_queued = HttpClient::Preconditions.assert_class('number_additions_queued', opts.delete(:number_additions_queued), Integer)
11788
+ @number_updates_queued = HttpClient::Preconditions.assert_class('number_updates_queued', opts.delete(:number_updates_queued), Integer)
11789
+ @catalog = (x = opts.delete(:catalog); x.is_a?(::Io::Flow::V0::Models::CatalogStatistics) ? x : ::Io::Flow::V0::Models::CatalogStatistics.new(x))
11790
+ end
11791
+
11792
+ def to_json
11793
+ JSON.dump(to_hash)
11794
+ end
11795
+
11796
+ def copy(incoming={})
11797
+ SubcatalogStatistics.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11798
+ end
11799
+
11800
+ def to_hash
11801
+ {
11802
+ :number_items => number_items,
11803
+ :number_categories => number_categories,
11804
+ :number_additions_queued => number_additions_queued,
11805
+ :number_updates_queued => number_updates_queued,
11806
+ :catalog => catalog.to_hash
11807
+ }
11808
+ end
11809
+
11810
+ end
11811
+
11776
11812
  class SubcatalogVersion
11777
11813
 
11778
11814
  attr_reader :id, :timestamp, :type, :subcatalog
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.