flowcommerce 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -25
- data/lib/clients/flow_catalog_v0_client.rb +96 -70
- data/lib/clients/flow_common_v0_client.rb +11 -11
- data/lib/clients/flow_experience_v0_client.rb +1040 -0
- data/lib/flow_commerce/client.rb +56 -1
- data/lib/flowcommerce.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c265a72646f875ea42247024e52ad13bd9362351
|
4
|
+
data.tar.gz: 76f8f5678c7ad813b99744f858aa4958a51eb23a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b4b15968a2b6c513a8177b74eacaeefaa0975089121fec6645e947e08ed902c34c92d96f2f2305537235bb19e25329b8c66f683b90f5bc3a0453783bd4e16a
|
7
|
+
data.tar.gz: 39c35efd1072a27f7e861dd452432304a3b072ea2fc86588d72bef258d7bad1f5fade3d347810d51dac809763c4d809f4878bdaacab215d6e5741422b60ee976
|
data/README.md
CHANGED
@@ -2,40 +2,34 @@
|
|
2
2
|
|
3
3
|
Native ruby client to the Flow API (https://api.flow.io)
|
4
4
|
|
5
|
-
##
|
6
|
-
|
7
|
-
gem install flowcommerce
|
8
|
-
|
9
|
-
|
10
|
-
## Usage
|
11
|
-
|
12
|
-
require 'flowcommerce'
|
13
|
-
|
14
|
-
org = "demo"
|
5
|
+
## Status
|
15
6
|
|
16
|
-
|
7
|
+
Please note that this library and APIs are in ALPHA and are subject to
|
8
|
+
change and will break in the future. Once Flow Commerce releases its
|
9
|
+
official 1.0 library, API changes will be backwards compatible. Until
|
10
|
+
then - we are super grateful for your patience as we finalize the API
|
11
|
+
for our launch.
|
17
12
|
|
18
|
-
|
13
|
+
Additionally, note that the final URL for the Flow Commerce API will
|
14
|
+
be https://api.flow.io - at the moment this domain is not ready, thus
|
15
|
+
you will see different clients used to access the catalog or to access
|
16
|
+
experience. This is temporary.
|
19
17
|
|
20
|
-
|
21
|
-
puts "# items in subcatalog: %s" % items.size
|
18
|
+
## Installation
|
22
19
|
|
20
|
+
gem install flowcommerce
|
23
21
|
|
24
22
|
## Example
|
25
23
|
|
26
|
-
|
24
|
+
1. Create a file named ~/.flow/token that contains your API token
|
25
|
+
and nothing else
|
27
26
|
|
27
|
+
2. ruby ./example.rb <org id>
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
The full API is documented at http://apidoc.me/flow/catalog/latest
|
29
|
+
Code for each example is in the examples directory, designed to really
|
30
|
+
highlight the use of key APIs in as clear a way as possible.
|
32
31
|
|
33
|
-
Also look at
|
34
|
-
https://github.com/flowcommerce/ruby-sdk/blob/master/lib/clients/flow_catalog_v0_client.rb
|
35
|
-
for the complete Ruby implementation of the API.
|
36
32
|
|
33
|
+
## Documentation
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
go run release.go
|
41
|
-
|
35
|
+
Complete API documentation is available at http://docs.flow.io
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.0.
|
3
|
-
# apidoc:0.11.
|
2
|
+
# Service version: 0.0.32
|
3
|
+
# apidoc:0.11.28 http://www.apidoc.me/flow/catalog/0.0.32/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -26,8 +26,8 @@ module Io
|
|
26
26
|
|
27
27
|
BASE_URL = 'https://catalog.api.flow.io' unless defined?(Constants::BASE_URL)
|
28
28
|
NAMESPACE = 'io.flow.catalog.v0' unless defined?(Constants::NAMESPACE)
|
29
|
-
USER_AGENT = 'apidoc:0.11.
|
30
|
-
VERSION = '0.0.
|
29
|
+
USER_AGENT = 'apidoc:0.11.28 http://www.apidoc.me/flow/catalog/0.0.32/ruby_client' unless defined?(Constants::USER_AGENT)
|
30
|
+
VERSION = '0.0.32' unless defined?(Constants::VERSION)
|
31
31
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
32
32
|
|
33
33
|
end
|
@@ -129,9 +129,10 @@ module Io
|
|
129
129
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
130
130
|
:name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, Array).map { |v| HttpClient::Preconditions.assert_class('name', v, String) }),
|
131
131
|
:position => (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Array).map { |v| HttpClient::Preconditions.assert_class('position', v, Integer) }),
|
132
|
+
:subcatalog => (x = opts.delete(:subcatalog); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog', x, Array).map { |v| HttpClient::Preconditions.assert_class('subcatalog', v, String) }),
|
132
133
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
133
134
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
134
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "
|
135
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
135
136
|
}.delete_if { |k, v| v.nil? }
|
136
137
|
r = @client.request("/#{CGI.escape(organization)}/functions").with_query(query).get
|
137
138
|
r.map { |x| ::Io::Flow::Catalog::V0::Models::Function.new(x) }
|
@@ -170,16 +171,6 @@ module Io
|
|
170
171
|
nil
|
171
172
|
end
|
172
173
|
|
173
|
-
# Sync functions
|
174
|
-
def post_events_by_id_and_event(organization, id, event, hash)
|
175
|
-
HttpClient::Preconditions.assert_class('organization', organization, String)
|
176
|
-
HttpClient::Preconditions.assert_class('id', id, String)
|
177
|
-
HttpClient::Preconditions.assert_class('event', event, String)
|
178
|
-
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
179
|
-
r = @client.request("/#{CGI.escape(organization)}/functions/#{CGI.escape(id)}/events/#{CGI.escape(event)}").with_json(hash.to_json).post
|
180
|
-
nil
|
181
|
-
end
|
182
|
-
|
183
174
|
end
|
184
175
|
|
185
176
|
class Items
|
@@ -213,17 +204,17 @@ module Io
|
|
213
204
|
:query => (x = opts.delete(:query); x.nil? ? nil : HttpClient::Preconditions.assert_class('query', x, String)),
|
214
205
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
215
206
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
216
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "
|
207
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
217
208
|
}.delete_if { |k, v| v.nil? }
|
218
209
|
r = @client.request("/#{CGI.escape(organization)}/catalog/items").with_query(query).get
|
219
210
|
r.map { |x| ::Io::Flow::Catalog::V0::Models::Item.new(x) }
|
220
211
|
end
|
221
212
|
|
222
213
|
# Returns information about a specific item.
|
223
|
-
def
|
214
|
+
def get_by_number(organization, number)
|
224
215
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
225
|
-
HttpClient::Preconditions.assert_class('
|
226
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(
|
216
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
217
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(number)}").get
|
227
218
|
::Io::Flow::Catalog::V0::Models::Item.new(r)
|
228
219
|
end
|
229
220
|
|
@@ -235,20 +226,20 @@ module Io
|
|
235
226
|
::Io::Flow::Catalog::V0::Models::Item.new(r)
|
236
227
|
end
|
237
228
|
|
238
|
-
# Update item with the specified
|
239
|
-
def
|
229
|
+
# Update item with the specified number, creating if it does not exist.
|
230
|
+
def put_by_number(organization, number, item_form)
|
240
231
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
241
|
-
HttpClient::Preconditions.assert_class('
|
232
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
242
233
|
HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::Catalog::V0::Models::ItemForm)
|
243
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(
|
234
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(number)}").with_json(item_form.to_json).put
|
244
235
|
::Io::Flow::Catalog::V0::Models::Item.new(r)
|
245
236
|
end
|
246
237
|
|
247
|
-
# Delete the item with this
|
248
|
-
def
|
238
|
+
# Delete the item with this number
|
239
|
+
def delete_by_number(organization, number)
|
249
240
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
250
|
-
HttpClient::Preconditions.assert_class('
|
251
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(
|
241
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
242
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/items/#{CGI.escape(number)}").delete
|
252
243
|
nil
|
253
244
|
end
|
254
245
|
|
@@ -266,6 +257,7 @@ module Io
|
|
266
257
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
267
258
|
query = {
|
268
259
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
260
|
+
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
269
261
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
270
262
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
271
263
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
@@ -280,6 +272,7 @@ module Io
|
|
280
272
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
281
273
|
query = {
|
282
274
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
275
|
+
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
283
276
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
284
277
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
285
278
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
@@ -289,10 +282,10 @@ module Io
|
|
289
282
|
end
|
290
283
|
|
291
284
|
# Returns information about a specific subcatalog.
|
292
|
-
def
|
285
|
+
def get_by_key(organization, key)
|
293
286
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
294
|
-
HttpClient::Preconditions.assert_class('
|
295
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(
|
287
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
288
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}").get
|
296
289
|
::Io::Flow::Catalog::V0::Models::Subcatalog.new(r)
|
297
290
|
end
|
298
291
|
|
@@ -304,47 +297,47 @@ module Io
|
|
304
297
|
::Io::Flow::Catalog::V0::Models::Subcatalog.new(r)
|
305
298
|
end
|
306
299
|
|
307
|
-
# Update subcatalog with the specified
|
308
|
-
def
|
300
|
+
# Update subcatalog with the specified key, creating if it does not exist.
|
301
|
+
def put_by_key(organization, key, subcatalog_form)
|
309
302
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
310
|
-
HttpClient::Preconditions.assert_class('
|
303
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
311
304
|
HttpClient::Preconditions.assert_class('subcatalog_form', subcatalog_form, ::Io::Flow::Catalog::V0::Models::SubcatalogForm)
|
312
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(
|
305
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}").with_json(subcatalog_form.to_json).put
|
313
306
|
::Io::Flow::Catalog::V0::Models::Subcatalog.new(r)
|
314
307
|
end
|
315
308
|
|
316
|
-
# Delete the subcatalog with this
|
317
|
-
def
|
309
|
+
# Delete the subcatalog with this key
|
310
|
+
def delete_by_key(organization, key)
|
318
311
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
319
|
-
HttpClient::Preconditions.assert_class('
|
320
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(
|
312
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
313
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}").delete
|
321
314
|
nil
|
322
315
|
end
|
323
316
|
|
324
317
|
# Returns information about a specific subcatalog's settings.
|
325
|
-
def
|
318
|
+
def get_settings_by_key(organization, key)
|
326
319
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
327
|
-
HttpClient::Preconditions.assert_class('
|
328
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(
|
320
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
321
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/settings").get
|
329
322
|
::Io::Flow::Catalog::V0::Models::SubcatalogSettings.new(r)
|
330
323
|
end
|
331
324
|
|
332
325
|
# Update subcatalog settings for the specified subcatalog.
|
333
|
-
def
|
326
|
+
def put_settings_by_key(organization, key, subcatalog_settings_form)
|
334
327
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
335
|
-
HttpClient::Preconditions.assert_class('
|
328
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
336
329
|
HttpClient::Preconditions.assert_class('subcatalog_settings_form', subcatalog_settings_form, ::Io::Flow::Catalog::V0::Models::SubcatalogSettingsForm)
|
337
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(
|
330
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/settings").with_json(subcatalog_settings_form.to_json).put
|
338
331
|
::Io::Flow::Catalog::V0::Models::SubcatalogSettings.new(r)
|
339
332
|
end
|
340
333
|
|
341
334
|
# Sync subcatalog
|
342
|
-
def
|
335
|
+
def post_events_by_key_and_event(organization, key, event, hash)
|
343
336
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
344
|
-
HttpClient::Preconditions.assert_class('
|
337
|
+
HttpClient::Preconditions.assert_class('key', key, String)
|
345
338
|
HttpClient::Preconditions.assert_class('event', event, String)
|
346
339
|
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
347
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(
|
340
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(key)}/events/#{CGI.escape(event)}").with_json(hash.to_json).post
|
348
341
|
nil
|
349
342
|
end
|
350
343
|
|
@@ -383,18 +376,18 @@ module Io
|
|
383
376
|
:query => (x = opts.delete(:query); x.nil? ? nil : HttpClient::Preconditions.assert_class('query', x, String)),
|
384
377
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
385
378
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
386
|
-
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "
|
379
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
387
380
|
}.delete_if { |k, v| v.nil? }
|
388
381
|
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items").with_query(query).get
|
389
382
|
r.map { |x| ::Io::Flow::Catalog::V0::Models::Item.new(x) }
|
390
383
|
end
|
391
384
|
|
392
385
|
# Returns information about specific subcatalog items.
|
393
|
-
def
|
386
|
+
def get_by_number(organization, subcatalog, number)
|
394
387
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
395
388
|
HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
|
396
|
-
HttpClient::Preconditions.assert_class('
|
397
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(
|
389
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
390
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(number)}").get
|
398
391
|
::Io::Flow::Catalog::V0::Models::Item.new(r)
|
399
392
|
end
|
400
393
|
|
@@ -407,22 +400,23 @@ module Io
|
|
407
400
|
::Io::Flow::Catalog::V0::Models::Item.new(r)
|
408
401
|
end
|
409
402
|
|
410
|
-
# Update subcatalog item with the specified
|
411
|
-
|
403
|
+
# Update subcatalog item with the specified number, creating if it does not
|
404
|
+
# exist.
|
405
|
+
def put_by_number(organization, subcatalog, number, item_form)
|
412
406
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
413
407
|
HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
|
414
|
-
HttpClient::Preconditions.assert_class('
|
408
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
415
409
|
HttpClient::Preconditions.assert_class('item_form', item_form, ::Io::Flow::Catalog::V0::Models::ItemForm)
|
416
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(
|
410
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(number)}").with_json(item_form.to_json).put
|
417
411
|
::Io::Flow::Catalog::V0::Models::Item.new(r)
|
418
412
|
end
|
419
413
|
|
420
|
-
# Delete the subcatalog item with this
|
421
|
-
def
|
414
|
+
# Delete the subcatalog item with this number
|
415
|
+
def delete_by_number(organization, subcatalog, number)
|
422
416
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
423
417
|
HttpClient::Preconditions.assert_class('subcatalog', subcatalog, String)
|
424
|
-
HttpClient::Preconditions.assert_class('
|
425
|
-
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(
|
418
|
+
HttpClient::Preconditions.assert_class('number', number, String)
|
419
|
+
r = @client.request("/#{CGI.escape(organization)}/catalog/subcatalogs/#{CGI.escape(subcatalog)}/items/#{CGI.escape(number)}").delete
|
426
420
|
nil
|
427
421
|
end
|
428
422
|
|
@@ -1029,6 +1023,8 @@ module Io
|
|
1029
1023
|
|
1030
1024
|
end
|
1031
1025
|
|
1026
|
+
# The URL to an image, with optional tags. Flow Commerce primarily uses images
|
1027
|
+
# to enhance the administrative tools (e.g. showing an item image in console)
|
1032
1028
|
class Image
|
1033
1029
|
|
1034
1030
|
attr_reader :url, :tags
|
@@ -1057,6 +1053,35 @@ module Io
|
|
1057
1053
|
|
1058
1054
|
end
|
1059
1055
|
|
1056
|
+
# Image form defines the data needed to create an image
|
1057
|
+
class ImageForm
|
1058
|
+
|
1059
|
+
attr_reader :url, :tags
|
1060
|
+
|
1061
|
+
def initialize(incoming={})
|
1062
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1063
|
+
HttpClient::Preconditions.require_keys(opts, [:url], 'ImageForm')
|
1064
|
+
@url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
|
1065
|
+
@tags = (x = opts.delete(:tags); x.nil? ? nil : HttpClient::Preconditions.assert_class('tags', x, Array).map { |v| HttpClient::Preconditions.assert_class('tags', v, String) })
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
def to_json
|
1069
|
+
JSON.dump(to_hash)
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
def copy(incoming={})
|
1073
|
+
ImageForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
def to_hash
|
1077
|
+
{
|
1078
|
+
:url => url,
|
1079
|
+
:tags => tags.nil? ? nil : tags
|
1080
|
+
}
|
1081
|
+
end
|
1082
|
+
|
1083
|
+
end
|
1084
|
+
|
1060
1085
|
# The Flow item defines a specific item that can be purchased by a consumer. For
|
1061
1086
|
# many clients, this will map to a Sku.
|
1062
1087
|
class Item
|
@@ -1126,7 +1151,7 @@ module Io
|
|
1126
1151
|
@description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
|
1127
1152
|
@attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::Catalog::V0::Models::Attribute) ? x : ::Io::Flow::Catalog::V0::Models::Attribute.new(x)) })
|
1128
1153
|
@dimensions = (x = opts.delete(:dimensions); x.nil? ? nil : HttpClient::Preconditions.assert_class('dimensions', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::Common::V0::Models::Dimension) ? x : ::Io::Flow::Common::V0::Models::Dimension.new(x)) })
|
1129
|
-
@images = (x = opts.delete(:images); x.nil? ? nil : HttpClient::Preconditions.assert_class('images', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::Catalog::V0::Models::
|
1154
|
+
@images = (x = opts.delete(:images); x.nil? ? nil : HttpClient::Preconditions.assert_class('images', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::Catalog::V0::Models::ImageForm) ? x : ::Io::Flow::Catalog::V0::Models::ImageForm.new(x)) })
|
1130
1155
|
end
|
1131
1156
|
|
1132
1157
|
def to_json
|
@@ -1341,12 +1366,13 @@ module Io
|
|
1341
1366
|
|
1342
1367
|
class SubcatalogForm
|
1343
1368
|
|
1344
|
-
attr_reader :
|
1369
|
+
attr_reader :country, :key, :query, :settings
|
1345
1370
|
|
1346
1371
|
def initialize(incoming={})
|
1347
1372
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
1373
|
+
HttpClient::Preconditions.require_keys(opts, [:country], 'SubcatalogForm')
|
1374
|
+
@country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
|
1348
1375
|
@key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
|
1349
|
-
@country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
|
1350
1376
|
@query = (x = opts.delete(:query); x.nil? ? nil : HttpClient::Preconditions.assert_class('query', x, String))
|
1351
1377
|
@settings = (x = opts.delete(:settings); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::Catalog::V0::Models::SubcatalogSettingsForm) ? x : ::Io::Flow::Catalog::V0::Models::SubcatalogSettingsForm.new(x)))
|
1352
1378
|
end
|
@@ -1361,8 +1387,8 @@ module Io
|
|
1361
1387
|
|
1362
1388
|
def to_hash
|
1363
1389
|
{
|
1364
|
-
:key => key,
|
1365
1390
|
:country => country,
|
1391
|
+
:key => key,
|
1366
1392
|
:query => query,
|
1367
1393
|
:settings => settings.nil? ? nil : settings.to_hash
|
1368
1394
|
}
|
@@ -1573,13 +1599,13 @@ module Io
|
|
1573
1599
|
client
|
1574
1600
|
end
|
1575
1601
|
|
1576
|
-
# If
|
1577
|
-
def configure_ssl(
|
1578
|
-
Preconditions.assert_class('
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1602
|
+
# If HTTPS is required, this method accepts an HTTP Client and configures SSL
|
1603
|
+
def configure_ssl(http)
|
1604
|
+
Preconditions.assert_class('http', http, Net::HTTP)
|
1605
|
+
http.use_ssl = true
|
1606
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
1607
|
+
http.cert_store = OpenSSL::X509::Store.new
|
1608
|
+
http.cert_store.set_default_paths
|
1583
1609
|
end
|
1584
1610
|
|
1585
1611
|
def get(&block)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.0.
|
3
|
-
# apidoc:0.11.
|
2
|
+
# Service version: 0.0.32
|
3
|
+
# apidoc:0.11.28 http://www.apidoc.me/flow/common/0.0.32/ruby_client
|
4
4
|
|
5
5
|
require 'cgi'
|
6
6
|
require 'net/http'
|
@@ -26,8 +26,8 @@ module Io
|
|
26
26
|
|
27
27
|
BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
|
28
28
|
NAMESPACE = 'io.flow.common.v0' unless defined?(Constants::NAMESPACE)
|
29
|
-
USER_AGENT = 'apidoc:0.11.
|
30
|
-
VERSION = '0.0.
|
29
|
+
USER_AGENT = 'apidoc:0.11.28 http://www.apidoc.me/flow/common/0.0.32/ruby_client' unless defined?(Constants::USER_AGENT)
|
30
|
+
VERSION = '0.0.32' unless defined?(Constants::VERSION)
|
31
31
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
32
32
|
|
33
33
|
end
|
@@ -1408,13 +1408,13 @@ module Io
|
|
1408
1408
|
client
|
1409
1409
|
end
|
1410
1410
|
|
1411
|
-
# If
|
1412
|
-
def configure_ssl(
|
1413
|
-
Preconditions.assert_class('
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1411
|
+
# If HTTPS is required, this method accepts an HTTP Client and configures SSL
|
1412
|
+
def configure_ssl(http)
|
1413
|
+
Preconditions.assert_class('http', http, Net::HTTP)
|
1414
|
+
http.use_ssl = true
|
1415
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
1416
|
+
http.cert_store = OpenSSL::X509::Store.new
|
1417
|
+
http.cert_store.set_default_paths
|
1418
1418
|
end
|
1419
1419
|
|
1420
1420
|
def get(&block)
|