flowcommerce 0.0.43 → 0.0.44

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: 04bbbdc58da616a838ae52f320818262e6ef4f20
4
- data.tar.gz: 4104225875ea7d310809f50b65823e8fe66d82f8
3
+ metadata.gz: c7e5ac128a7414395dd4273c40e55cd66745043f
4
+ data.tar.gz: 30c9c99972a7cc2152b50969401c2e4e70373d26
5
5
  SHA512:
6
- metadata.gz: 4d2a2751453741e63844d7aaff0c8573d63b2bc1cacfc7502ef2296adf57293f00ce4bd84645c9ea9b9b4e503400e665c018a6bf97fa7b33d392983af7972992
7
- data.tar.gz: 27d59097c695ec8aed6eb62760f1ce4e21956a7a798604346f0dcdb63058f3b9a64f69c8744dfba6b9d876c7b6fe049eac19809ca2953a15f230952129daf617
6
+ metadata.gz: 036112b83bbf4995ffce397c3933611413a1485d9b855c9348ee663c881531eb16d5c1841166254ecfece48e032e6506d3dc1a3a244eb47fea316986ca785a48
7
+ data.tar.gz: 76032d60afe4d2a37fd6614cef5fff227800435cb603235e6b7d188b041e9b412b9c4914f79291dc23afae2c55cfe77e7daedc86cd07767801777ecffdc32864
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.1.20
3
- # apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.20/ruby_client
2
+ # Service version: 0.1.23
3
+ # apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.23/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.34 http://www.apidoc.me/flow/api/0.1.20/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.1.20' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.34 http://www.apidoc.me/flow/api/0.1.23/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.1.23' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -153,6 +153,10 @@ module Io
153
153
  @cards ||= ::Io::Flow::V0::Clients::Cards.new(self)
154
154
  end
155
155
 
156
+ def public_keys
157
+ @public_keys ||= ::Io::Flow::V0::Clients::PublicKeys.new(self)
158
+ end
159
+
156
160
  def refunds
157
161
  @refunds ||= ::Io::Flow::V0::Clients::Refunds.new(self)
158
162
  end
@@ -197,6 +201,10 @@ module Io
197
201
  @services ||= ::Io::Flow::V0::Clients::Services.new(self)
198
202
  end
199
203
 
204
+ def shipping_labels
205
+ @shipping_labels ||= ::Io::Flow::V0::Clients::ShippingLabels.new(self)
206
+ end
207
+
200
208
  def tiers
201
209
  @tiers ||= ::Io::Flow::V0::Clients::Tiers.new(self)
202
210
  end
@@ -285,10 +293,6 @@ module Io
285
293
  @password_reset_forms ||= ::Io::Flow::V0::Clients::PasswordResetForms.new(self)
286
294
  end
287
295
 
288
- def shipping_labels
289
- @shipping_labels ||= ::Io::Flow::V0::Clients::ShippingLabels.new(self)
290
- end
291
-
292
296
  def suggestions
293
297
  @suggestions ||= ::Io::Flow::V0::Clients::Suggestions.new(self)
294
298
  end
@@ -1212,11 +1216,19 @@ module Io
1212
1216
  ::Io::Flow::V0::Models::OrganizationCurrencySetting.new(r)
1213
1217
  end
1214
1218
 
1215
- # Create organization currency settings, or update if they already exist.
1216
- def put(organization, organization_currency_setting_form)
1219
+ def get_by_id(organization, id)
1217
1220
  HttpClient::Preconditions.assert_class('organization', organization, String)
1221
+ HttpClient::Preconditions.assert_class('id', id, String)
1222
+ r = @client.request("/#{CGI.escape(organization)}/currency/settings/#{CGI.escape(id)}").get
1223
+ ::Io::Flow::V0::Models::OrganizationCurrencySetting.new(r)
1224
+ end
1225
+
1226
+ # Update an existing organization currency setting by id.
1227
+ def put_by_id(organization, id, organization_currency_setting_form)
1228
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1229
+ HttpClient::Preconditions.assert_class('id', id, String)
1218
1230
  HttpClient::Preconditions.assert_class('organization_currency_setting_form', organization_currency_setting_form, ::Io::Flow::V0::Models::OrganizationCurrencySettingForm)
1219
- r = @client.request("/#{CGI.escape(organization)}/currency/settings").with_json(organization_currency_setting_form.to_json).put
1231
+ r = @client.request("/#{CGI.escape(organization)}/currency/settings/#{CGI.escape(id)}").with_json(organization_currency_setting_form.to_json).put
1220
1232
  ::Io::Flow::V0::Models::OrganizationCurrencySetting.new(r)
1221
1233
  end
1222
1234
 
@@ -1274,12 +1286,12 @@ module Io
1274
1286
  ::Io::Flow::V0::Models::Rate.new(r)
1275
1287
  end
1276
1288
 
1277
- # Create a currency conversion rate for an organization, or update the rate if
1278
- # it already exists.
1279
- def put(organization, rate_form)
1289
+ # Update an existing rate by id.
1290
+ def put_by_id(organization, id, rate_form)
1280
1291
  HttpClient::Preconditions.assert_class('organization', organization, String)
1292
+ HttpClient::Preconditions.assert_class('id', id, String)
1281
1293
  HttpClient::Preconditions.assert_class('rate_form', rate_form, ::Io::Flow::V0::Models::RateForm)
1282
- r = @client.request("/#{CGI.escape(organization)}/currency/rates").with_json(rate_form.to_json).put
1294
+ r = @client.request("/#{CGI.escape(organization)}/currency/rates/#{CGI.escape(id)}").with_json(rate_form.to_json).put
1283
1295
  ::Io::Flow::V0::Models::Rate.new(r)
1284
1296
  end
1285
1297
 
@@ -1836,6 +1848,28 @@ module Io
1836
1848
 
1837
1849
  end
1838
1850
 
1851
+ class PublicKeys
1852
+
1853
+ def initialize(client)
1854
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
1855
+ end
1856
+
1857
+ # Returns your public keys
1858
+ def get(organization, incoming={})
1859
+ HttpClient::Preconditions.assert_class('organization', organization, String)
1860
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1861
+ query = {
1862
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1863
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1864
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1865
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
1866
+ }.delete_if { |k, v| v.nil? }
1867
+ r = @client.request("/#{CGI.escape(organization)}/encryption/keys").with_query(query).get
1868
+ r.map { |x| ::Io::Flow::V0::Models::PublicKey.new(x) }
1869
+ end
1870
+
1871
+ end
1872
+
1839
1873
  class Refunds
1840
1874
 
1841
1875
  def initialize(client)
@@ -2313,6 +2347,58 @@ module Io
2313
2347
 
2314
2348
  end
2315
2349
 
2350
+ class ShippingLabels
2351
+
2352
+ def initialize(client)
2353
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2354
+ end
2355
+
2356
+ def get(organization, incoming={})
2357
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2358
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2359
+ query = {
2360
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2361
+ :carrier_tracking_number => (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier_tracking_number', v, String) }),
2362
+ :flow_tracking_number => (x = opts.delete(:flow_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('flow_tracking_number', v, String) }),
2363
+ :service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
2364
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2365
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2366
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2367
+ }.delete_if { |k, v| v.nil? }
2368
+ r = @client.request("/#{CGI.escape(organization)}/shipping_label").with_query(query).get
2369
+ r.map { |x| ::Io::Flow::V0::Models::ShippingLabel.new(x) }
2370
+ end
2371
+
2372
+ def post(organization, shipping_label_form)
2373
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2374
+ HttpClient::Preconditions.assert_class('shipping_label_form', shipping_label_form, ::Io::Flow::V0::Models::ShippingLabelForm)
2375
+ r = @client.request("/#{CGI.escape(organization)}/shipping_label").with_json(shipping_label_form.to_json).post
2376
+ ::Io::Flow::V0::Models::ShippingLabel.new(r)
2377
+ end
2378
+
2379
+ def get_by_id(organization, id)
2380
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2381
+ HttpClient::Preconditions.assert_class('id', id, String)
2382
+ r = @client.request("/#{CGI.escape(organization)}/shipping_label/#{CGI.escape(id)}").get
2383
+ ::Io::Flow::V0::Models::ShippingLabel.new(r)
2384
+ end
2385
+
2386
+ def get_versions(organization, incoming={})
2387
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2388
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2389
+ query = {
2390
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2391
+ :label => (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, Array).map { |v| HttpClient::Preconditions.assert_class('label', v, String) }),
2392
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2393
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2394
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2395
+ }.delete_if { |k, v| v.nil? }
2396
+ r = @client.request("/#{CGI.escape(organization)}/shipping_label/versions").with_query(query).get
2397
+ r.map { |x| ::Io::Flow::V0::Models::ShippingLabelVersion.new(x) }
2398
+ end
2399
+
2400
+ end
2401
+
2316
2402
  class Tiers
2317
2403
 
2318
2404
  def initialize(client)
@@ -3138,58 +3224,6 @@ module Io
3138
3224
 
3139
3225
  end
3140
3226
 
3141
- class ShippingLabels
3142
-
3143
- def initialize(client)
3144
- @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3145
- end
3146
-
3147
- def get(organization, incoming={})
3148
- HttpClient::Preconditions.assert_class('organization', organization, String)
3149
- opts = HttpClient::Helper.symbolize_keys(incoming)
3150
- query = {
3151
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3152
- :carrier_tracking_number => (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier_tracking_number', v, String) }),
3153
- :flow_tracking_number => (x = opts.delete(:flow_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('flow_tracking_number', v, String) }),
3154
- :service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
3155
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3156
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3157
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
3158
- }.delete_if { |k, v| v.nil? }
3159
- r = @client.request("/#{CGI.escape(organization)}/shipping_label").with_query(query).get
3160
- r.map { |x| ::Io::Flow::V0::Models::ShippingLabel.new(x) }
3161
- end
3162
-
3163
- def post(organization, shipping_label_form)
3164
- HttpClient::Preconditions.assert_class('organization', organization, String)
3165
- HttpClient::Preconditions.assert_class('shipping_label_form', shipping_label_form, ::Io::Flow::V0::Models::ShippingLabelForm)
3166
- r = @client.request("/#{CGI.escape(organization)}/shipping_label").with_json(shipping_label_form.to_json).post
3167
- ::Io::Flow::V0::Models::ShippingLabel.new(r)
3168
- end
3169
-
3170
- def get_by_id(organization, id)
3171
- HttpClient::Preconditions.assert_class('organization', organization, String)
3172
- HttpClient::Preconditions.assert_class('id', id, String)
3173
- r = @client.request("/#{CGI.escape(organization)}/shipping_label/#{CGI.escape(id)}").get
3174
- ::Io::Flow::V0::Models::ShippingLabel.new(r)
3175
- end
3176
-
3177
- def get_versions(organization, incoming={})
3178
- HttpClient::Preconditions.assert_class('organization', organization, String)
3179
- opts = HttpClient::Helper.symbolize_keys(incoming)
3180
- query = {
3181
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3182
- :label => (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, Array).map { |v| HttpClient::Preconditions.assert_class('label', v, String) }),
3183
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3184
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3185
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
3186
- }.delete_if { |k, v| v.nil? }
3187
- r = @client.request("/#{CGI.escape(organization)}/shipping_label/versions").with_query(query).get
3188
- r.map { |x| ::Io::Flow::V0::Models::ShippingLabelVersion.new(x) }
3189
- end
3190
-
3191
- end
3192
-
3193
3227
  class Suggestions
3194
3228
 
3195
3229
  def initialize(client)
@@ -11951,17 +11985,18 @@ module Io
11951
11985
 
11952
11986
  class OrganizationUpserted < Event
11953
11987
 
11954
- attr_reader :event_id, :timestamp, :id, :name, :environment, :parent_id
11988
+ attr_reader :event_id, :timestamp, :id, :name, :environment, :currencies, :parent_id
11955
11989
 
11956
11990
  def initialize(incoming={})
11957
11991
  super(:name => Event::Types::ORGANIZATION_UPSERTED)
11958
11992
  opts = HttpClient::Helper.symbolize_keys(incoming)
11959
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :name, :environment], 'OrganizationUpserted')
11993
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :name, :environment, :currencies], 'OrganizationUpserted')
11960
11994
  @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11961
11995
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11962
11996
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
11963
11997
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
11964
11998
  @environment = HttpClient::Preconditions.assert_class('environment', opts.delete(:environment), String)
11999
+ @currencies = HttpClient::Preconditions.assert_class('currencies', opts.delete(:currencies), Array).map { |v| HttpClient::Preconditions.assert_class('currencies', v, String) }
11965
12000
  @parent_id = (x = opts.delete(:parent_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent_id', x, String))
11966
12001
  end
11967
12002
 
@@ -11980,6 +12015,7 @@ module Io
11980
12015
  :id => id,
11981
12016
  :name => name,
11982
12017
  :environment => environment,
12018
+ :currencies => currencies,
11983
12019
  :parent_id => parent_id
11984
12020
  }
11985
12021
  end
@@ -12337,6 +12373,34 @@ module Io
12337
12373
 
12338
12374
  end
12339
12375
 
12376
+ # A public key is used to encrypt cards client side prior to submitting to the
12377
+ # Flow vault.
12378
+ class PublicKey
12379
+
12380
+ attr_reader :id
12381
+
12382
+ def initialize(incoming={})
12383
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12384
+ HttpClient::Preconditions.require_keys(opts, [:id], 'PublicKey')
12385
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
12386
+ end
12387
+
12388
+ def to_json
12389
+ JSON.dump(to_hash)
12390
+ end
12391
+
12392
+ def copy(incoming={})
12393
+ PublicKey.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12394
+ end
12395
+
12396
+ def to_hash
12397
+ {
12398
+ :id => id
12399
+ }
12400
+ end
12401
+
12402
+ end
12403
+
12340
12404
  # Represents a typed query to indicate which items to include or exclude in a
12341
12405
  # subcatalog
12342
12406
  class Query
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.43
4
+ version: 0.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-26 00:00:00.000000000 Z
11
+ date: 2016-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -45,7 +45,6 @@ extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
47
  - README.md
48
- - lib/flow_commerce/#flow_api_v0_client.rb#
49
48
  - lib/flow_commerce/client.rb
50
49
  - lib/flow_commerce/flow_api_v0_client.rb
51
50
  - lib/flowcommerce.rb