flowcommerce 0.2.87 → 0.2.88

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
- SHA256:
3
- metadata.gz: f4f09a9394c37c46d0920cf85937ec7c1461c0e80edde6b6d28f6128f612d6a5
4
- data.tar.gz: ed48759a85e97d8aee99fc152c220e04f7f2eff7847f955737114a528340a4ce
2
+ SHA1:
3
+ metadata.gz: 2a71e4b1f00cc09abb9b4318b6dad318bdddbd5a
4
+ data.tar.gz: 9fdabc6f76f946008ead2620c3667258321b10c8
5
5
  SHA512:
6
- metadata.gz: 704b4df67ee004259b25fa763fbfeae4523285435ce478023e51a2f54c194eeebcd528c5d4df1dd97cc87340c2294dab41d543321e4067934d5f987bca659031
7
- data.tar.gz: 45e805bd254c6f997b2cf2f52fbef624777f2f325d0ca674cd8f25833857986ce5e63ea6c169ab09463526be6e6f238978c07f829225d28c78ce4f3bb4f05110
6
+ metadata.gz: 76451af39a4ace0561ebd241272c94ed58e5625847e0a80c9816d5afe15c8f97f9df9ccf9d8e697f442f9d669baae3c976138f334e9878b775a1fdb60e9289de
7
+ data.tar.gz: e1a43c81eb365db06786ef4acc9c35d64cf1e9a67d153204145725a7e0e0ab522dff8eb8ffe6ac97a3a512d70a1adba3b770892a5830951195d1a1f811c8e3fd
data/README.md CHANGED
@@ -2,13 +2,6 @@
2
2
 
3
3
  Native ruby client to the Flow API (https://api.flow.io)
4
4
 
5
- ## Status
6
-
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.
12
5
 
13
6
  ## Installation
14
7
 
@@ -1,5 +1,5 @@
1
1
  # Generated by API Builder - https://www.apibuilder.io
2
- # Service version: 0.9.76
2
+ # Service version: 0.9.77
3
3
  # apibuilder 0.15.11 app.apibuilder.io/flow/api/latest/ruby_client
4
4
 
5
5
  require 'cgi'
@@ -26,7 +26,7 @@ module Io
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
28
  USER_AGENT = 'apibuilder 0.15.11 app.apibuilder.io/flow/api/latest/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.9.76' unless defined?(Constants::VERSION)
29
+ VERSION = '0.9.77' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -849,10 +849,14 @@ module Io
849
849
  r.map { |x| ::Io::Flow::V0::Models::CheckoutAttribute.new(x) }
850
850
  end
851
851
 
852
- def post(organization, checkout_attribute_form)
852
+ def post(organization, checkout_attribute_form, incoming={})
853
853
  HttpClient::Preconditions.assert_class('organization', organization, String)
854
+ opts = HttpClient::Helper.symbolize_keys(incoming)
855
+ query = {
856
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
857
+ }.delete_if { |k, v| v.nil? }
854
858
  (x = checkout_attribute_form; x.is_a?(::Io::Flow::V0::Models::CheckoutAttributeForm) ? x : ::Io::Flow::V0::Models::CheckoutAttributeForm.new(x))
855
- r = @client.request("/#{CGI.escape(organization)}/checkout/attributes").with_json(checkout_attribute_form.to_json).post
859
+ r = @client.request("/#{CGI.escape(organization)}/checkout/attributes").with_query(query).with_json(checkout_attribute_form.to_json).post
856
860
  ::Io::Flow::V0::Models::CheckoutAttribute.new(r)
857
861
  end
858
862
 
@@ -863,11 +867,15 @@ module Io
863
867
  ::Io::Flow::V0::Models::CheckoutAttribute.new(r)
864
868
  end
865
869
 
866
- def put_by_id(organization, id, checkout_attribute_form)
870
+ def put_by_id(organization, id, checkout_attribute_form, incoming={})
867
871
  HttpClient::Preconditions.assert_class('organization', organization, String)
868
872
  HttpClient::Preconditions.assert_class('id', id, String)
873
+ opts = HttpClient::Helper.symbolize_keys(incoming)
874
+ query = {
875
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
876
+ }.delete_if { |k, v| v.nil? }
869
877
  (x = checkout_attribute_form; x.is_a?(::Io::Flow::V0::Models::CheckoutAttributeForm) ? x : ::Io::Flow::V0::Models::CheckoutAttributeForm.new(x))
870
- r = @client.request("/#{CGI.escape(organization)}/checkout/attributes/#{CGI.escape(id)}").with_json(checkout_attribute_form.to_json).put
878
+ r = @client.request("/#{CGI.escape(organization)}/checkout/attributes/#{CGI.escape(id)}").with_query(query).with_json(checkout_attribute_form.to_json).put
871
879
  ::Io::Flow::V0::Models::CheckoutAttribute.new(r)
872
880
  end
873
881
 
@@ -896,7 +904,8 @@ module Io
896
904
  query = {
897
905
  :number => (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, Array).map { |v| HttpClient::Preconditions.assert_class('number', v, String) }),
898
906
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
899
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer)
907
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
908
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
900
909
  }.delete_if { |k, v| v.nil? }
901
910
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/item/content/checkout").with_query(query).get
902
911
  r.map { |x| ::Io::Flow::V0::Models::CheckoutItemContent.new(x) }
@@ -1071,10 +1080,14 @@ module Io
1071
1080
  end
1072
1081
 
1073
1082
  # Add experience
1074
- def post(organization, experience_form)
1083
+ def post(organization, experience_form, incoming={})
1075
1084
  HttpClient::Preconditions.assert_class('organization', organization, String)
1085
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1086
+ query = {
1087
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1088
+ }.delete_if { |k, v| v.nil? }
1076
1089
  (x = experience_form; x.is_a?(::Io::Flow::V0::Models::ExperienceForm) ? x : ::Io::Flow::V0::Models::ExperienceForm.new(x))
1077
- r = @client.request("/#{CGI.escape(organization)}/experiences").with_json(experience_form.to_json).post
1090
+ r = @client.request("/#{CGI.escape(organization)}/experiences").with_query(query).with_json(experience_form.to_json).post
1078
1091
  ::Io::Flow::V0::Models::Experience.new(r)
1079
1092
  end
1080
1093
 
@@ -1151,6 +1164,7 @@ module Io
1151
1164
  query = {
1152
1165
  :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
1153
1166
  :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
1167
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)),
1154
1168
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1155
1169
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1156
1170
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
@@ -1159,18 +1173,26 @@ module Io
1159
1173
  r.map { |x| ::Io::Flow::V0::Models::ExperienceVersion.new(x) }
1160
1174
  end
1161
1175
 
1162
- def get_currency_and_formats_by_experience_key(organization, experience_key)
1176
+ def get_currency_and_formats_by_experience_key(organization, experience_key, incoming={})
1163
1177
  HttpClient::Preconditions.assert_class('organization', organization, String)
1164
1178
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1165
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/currency/formats").get
1179
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1180
+ query = {
1181
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1182
+ }.delete_if { |k, v| v.nil? }
1183
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/currency/formats").with_query(query).get
1166
1184
  ::Io::Flow::V0::Models::ExperienceCurrencyFormat.new(r)
1167
1185
  end
1168
1186
 
1169
- def put_currency_and_formats_by_experience_key(organization, experience_key, experience_currency_format_form)
1187
+ def put_currency_and_formats_by_experience_key(organization, experience_key, experience_currency_format_form, incoming={})
1170
1188
  HttpClient::Preconditions.assert_class('organization', organization, String)
1171
1189
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1190
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1191
+ query = {
1192
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1193
+ }.delete_if { |k, v| v.nil? }
1172
1194
  (x = experience_currency_format_form; x.is_a?(::Io::Flow::V0::Models::ExperienceCurrencyFormatForm) ? x : ::Io::Flow::V0::Models::ExperienceCurrencyFormatForm.new(x))
1173
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/currency/formats").with_json(experience_currency_format_form.to_json).put
1195
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/currency/formats").with_query(query).with_json(experience_currency_format_form.to_json).put
1174
1196
  ::Io::Flow::V0::Models::ExperienceCurrencyFormat.new(r)
1175
1197
  end
1176
1198
 
@@ -1216,11 +1238,15 @@ module Io
1216
1238
  r.map { |x| ::Io::Flow::V0::Models::ItemMargin.new(x) }
1217
1239
  end
1218
1240
 
1219
- def post_margins_by_experience_key(organization, experience_key, item_margin_post_form)
1241
+ def post_margins_by_experience_key(organization, experience_key, item_margin_post_form, incoming={})
1220
1242
  HttpClient::Preconditions.assert_class('organization', organization, String)
1221
1243
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1244
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1245
+ query = {
1246
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1247
+ }.delete_if { |k, v| v.nil? }
1222
1248
  (x = item_margin_post_form; x.is_a?(::Io::Flow::V0::Models::ItemMarginPostForm) ? x : ::Io::Flow::V0::Models::ItemMarginPostForm.new(x))
1223
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins").with_json(item_margin_post_form.to_json).post
1249
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins").with_query(query).with_json(item_margin_post_form.to_json).post
1224
1250
  ::Io::Flow::V0::Models::ItemMargin.new(r)
1225
1251
  end
1226
1252
 
@@ -1246,12 +1272,16 @@ module Io
1246
1272
  ::Io::Flow::V0::Models::ItemMargin.new(r)
1247
1273
  end
1248
1274
 
1249
- def put_margins_by_experience_key_and_key(organization, experience_key, key, item_margin_put_form)
1275
+ def put_margins_by_experience_key_and_key(organization, experience_key, key, item_margin_put_form, incoming={})
1250
1276
  HttpClient::Preconditions.assert_class('organization', organization, String)
1251
1277
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1252
1278
  HttpClient::Preconditions.assert_class('key', key, String)
1279
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1280
+ query = {
1281
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1282
+ }.delete_if { |k, v| v.nil? }
1253
1283
  (x = item_margin_put_form; x.is_a?(::Io::Flow::V0::Models::ItemMarginPutForm) ? x : ::Io::Flow::V0::Models::ItemMarginPutForm.new(x))
1254
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins/#{CGI.escape(key)}").with_json(item_margin_put_form.to_json).put
1284
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/margins/#{CGI.escape(key)}").with_query(query).with_json(item_margin_put_form.to_json).put
1255
1285
  ::Io::Flow::V0::Models::ItemMargin.new(r)
1256
1286
  end
1257
1287
 
@@ -1269,7 +1299,8 @@ module Io
1269
1299
  opts = HttpClient::Helper.symbolize_keys(incoming)
1270
1300
  query = {
1271
1301
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1272
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer)
1302
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1303
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1273
1304
  }.delete_if { |k, v| v.nil? }
1274
1305
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment-method-types").with_query(query).get
1275
1306
  r.map { |x| ::Io::Flow::V0::Models::PaymentMethodType.new(x) }
@@ -1283,7 +1314,8 @@ module Io
1283
1314
  :payment_method_type => (x = opts.delete(:payment_method_type); x.nil? ? nil : HttpClient::Preconditions.assert_class('payment_method_type', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodType) ? x : ::Io::Flow::V0::Models::PaymentMethodType.apply(x)).value }),
1284
1315
  :tags => (x = opts.delete(:tags); x.nil? ? nil : HttpClient::Preconditions.assert_class('tags', x, Array).map { |v| HttpClient::Preconditions.assert_class('tags', v, String) }),
1285
1316
  :amount => (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', x, String)),
1286
- :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
1317
+ :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
1318
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1287
1319
  }.delete_if { |k, v| v.nil? }
1288
1320
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment/method/rules").with_query(query).get
1289
1321
  r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
@@ -1291,11 +1323,15 @@ module Io
1291
1323
 
1292
1324
  # Change the ordering or payment tags for an experience. Every post must
1293
1325
  # include one entry for each payment method offered by Flow.
1294
- def put_payment_and_method_and_rules_by_experience_key(organization, experience_key, experience_payment_method_rule_forms)
1326
+ def put_payment_and_method_and_rules_by_experience_key(organization, experience_key, experience_payment_method_rule_forms, incoming={})
1295
1327
  HttpClient::Preconditions.assert_class('organization', organization, String)
1296
1328
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1329
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1330
+ query = {
1331
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1332
+ }.delete_if { |k, v| v.nil? }
1297
1333
  HttpClient::Preconditions.assert_class('experience_payment_method_rule_forms', experience_payment_method_rule_forms, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperiencePaymentMethodRuleForm) ? x : ::Io::Flow::V0::Models::ExperiencePaymentMethodRuleForm.new(x)) }
1298
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment/method/rules").with_json(experience_payment_method_rule_forms.map { |o| o.to_hash }.to_json).put
1334
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/payment/method/rules").with_query(query).with_json(experience_payment_method_rule_forms.map { |o| o.to_hash }.to_json).put
1299
1335
  r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) }
1300
1336
  end
1301
1337
 
@@ -1314,19 +1350,27 @@ module Io
1314
1350
  r.map { |x| ::Io::Flow::V0::Models::ExperiencePriceBookMapping.new(x) }
1315
1351
  end
1316
1352
 
1317
- def post_price_and_books_by_experience_key(organization, experience_key, experience_price_book_mapping_form)
1353
+ def post_price_and_books_by_experience_key(organization, experience_key, experience_price_book_mapping_form, incoming={})
1318
1354
  HttpClient::Preconditions.assert_class('organization', organization, String)
1319
1355
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1356
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1357
+ query = {
1358
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1359
+ }.delete_if { |k, v| v.nil? }
1320
1360
  (x = experience_price_book_mapping_form; x.is_a?(::Io::Flow::V0::Models::ExperiencePriceBookMappingForm) ? x : ::Io::Flow::V0::Models::ExperiencePriceBookMappingForm.new(x))
1321
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/price/books").with_json(experience_price_book_mapping_form.to_json).post
1361
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/price/books").with_query(query).with_json(experience_price_book_mapping_form.to_json).post
1322
1362
  ::Io::Flow::V0::Models::ExperiencePriceBookMapping.new(r)
1323
1363
  end
1324
1364
 
1325
- def put_price_and_books_by_experience_key(organization, experience_key, experience_price_book_mapping_put_form)
1365
+ def put_price_and_books_by_experience_key(organization, experience_key, experience_price_book_mapping_put_form, incoming={})
1326
1366
  HttpClient::Preconditions.assert_class('organization', organization, String)
1327
1367
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1368
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1369
+ query = {
1370
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1371
+ }.delete_if { |k, v| v.nil? }
1328
1372
  (x = experience_price_book_mapping_put_form; x.is_a?(::Io::Flow::V0::Models::ExperiencePriceBookMappingPutForm) ? x : ::Io::Flow::V0::Models::ExperiencePriceBookMappingPutForm.new(x))
1329
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/price/books").with_json(experience_price_book_mapping_put_form.to_json).put
1373
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/price/books").with_query(query).with_json(experience_price_book_mapping_put_form.to_json).put
1330
1374
  r.map { |x| ::Io::Flow::V0::Models::ExperiencePriceBookMapping.new(x) }
1331
1375
  end
1332
1376
 
@@ -1347,37 +1391,53 @@ module Io
1347
1391
  end
1348
1392
 
1349
1393
  # Returns information about a specific experience.
1350
- def get_by_key(organization, key)
1394
+ def get_by_key(organization, key, incoming={})
1351
1395
  HttpClient::Preconditions.assert_class('organization', organization, String)
1352
1396
  HttpClient::Preconditions.assert_class('key', key, String)
1353
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").get
1397
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1398
+ query = {
1399
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1400
+ }.delete_if { |k, v| v.nil? }
1401
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").with_query(query).get
1354
1402
  ::Io::Flow::V0::Models::Experience.new(r)
1355
1403
  end
1356
1404
 
1357
1405
  # Update experience with the specified key, creating if it does not exist.
1358
- def put_by_key(organization, key, experience_form)
1406
+ def put_by_key(organization, key, experience_form, incoming={})
1359
1407
  HttpClient::Preconditions.assert_class('organization', organization, String)
1360
1408
  HttpClient::Preconditions.assert_class('key', key, String)
1409
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1410
+ query = {
1411
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1412
+ }.delete_if { |k, v| v.nil? }
1361
1413
  (x = experience_form; x.is_a?(::Io::Flow::V0::Models::ExperienceForm) ? x : ::Io::Flow::V0::Models::ExperienceForm.new(x))
1362
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").with_json(experience_form.to_json).put
1414
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").with_query(query).with_json(experience_form.to_json).put
1363
1415
  ::Io::Flow::V0::Models::Experience.new(r)
1364
1416
  end
1365
1417
 
1366
1418
  # Delete the experience with this key
1367
- def delete_by_key(organization, key)
1419
+ def delete_by_key(organization, key, incoming={})
1368
1420
  HttpClient::Preconditions.assert_class('organization', organization, String)
1369
1421
  HttpClient::Preconditions.assert_class('key', key, String)
1370
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").delete
1422
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1423
+ query = {
1424
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1425
+ }.delete_if { |k, v| v.nil? }
1426
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}").with_query(query).delete
1371
1427
  nil
1372
1428
  end
1373
1429
 
1374
1430
  # Clones the experience with the specified key, using data from
1375
1431
  # experience_clone_form.
1376
- def post_clone_by_key(organization, key, experience_clone_form)
1432
+ def post_clone_by_key(organization, key, experience_clone_form, incoming={})
1377
1433
  HttpClient::Preconditions.assert_class('organization', organization, String)
1378
1434
  HttpClient::Preconditions.assert_class('key', key, String)
1435
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1436
+ query = {
1437
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1438
+ }.delete_if { |k, v| v.nil? }
1379
1439
  (x = experience_clone_form; x.is_a?(::Io::Flow::V0::Models::ExperienceCloneForm) ? x : ::Io::Flow::V0::Models::ExperienceCloneForm.new(x))
1380
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/clone").with_json(experience_clone_form.to_json).post
1440
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/clone").with_query(query).with_json(experience_clone_form.to_json).post
1381
1441
  ::Io::Flow::V0::Models::ExperienceClone.new(r)
1382
1442
  end
1383
1443
 
@@ -1412,10 +1472,14 @@ module Io
1412
1472
  end
1413
1473
 
1414
1474
  # Get the pricing settings for this experience
1415
- def get_pricing_by_key(organization, key)
1475
+ def get_pricing_by_key(organization, key, incoming={})
1416
1476
  HttpClient::Preconditions.assert_class('organization', organization, String)
1417
1477
  HttpClient::Preconditions.assert_class('key', key, String)
1418
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/pricing").get
1478
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1479
+ query = {
1480
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1481
+ }.delete_if { |k, v| v.nil? }
1482
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/pricing").with_query(query).get
1419
1483
  ::Io::Flow::V0::Models::Pricing.new(r)
1420
1484
  end
1421
1485
 
@@ -1433,19 +1497,27 @@ module Io
1433
1497
  end
1434
1498
 
1435
1499
  # Get available promotions for the experience
1436
- def get_promotions_and_available_by_key(organization, key)
1500
+ def get_promotions_and_available_by_key(organization, key, incoming={})
1437
1501
  HttpClient::Preconditions.assert_class('organization', organization, String)
1438
1502
  HttpClient::Preconditions.assert_class('key', key, String)
1439
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/promotions/available").get
1503
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1504
+ query = {
1505
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1506
+ }.delete_if { |k, v| v.nil? }
1507
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/promotions/available").with_query(query).get
1440
1508
  r.map { |x| ::Io::Flow::V0::Models::Promotion.from_json(x) }
1441
1509
  end
1442
1510
 
1443
1511
  # Updates the status of a given experience.
1444
- def put_status_by_key(organization, key, experience_status_form)
1512
+ def put_status_by_key(organization, key, experience_status_form, incoming={})
1445
1513
  HttpClient::Preconditions.assert_class('organization', organization, String)
1446
1514
  HttpClient::Preconditions.assert_class('key', key, String)
1515
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1516
+ query = {
1517
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1518
+ }.delete_if { |k, v| v.nil? }
1447
1519
  (x = experience_status_form; x.is_a?(::Io::Flow::V0::Models::ExperienceStatusForm) ? x : ::Io::Flow::V0::Models::ExperienceStatusForm.new(x))
1448
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/status").with_json(experience_status_form.to_json).put
1520
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/status").with_query(query).with_json(experience_status_form.to_json).put
1449
1521
  ::Io::Flow::V0::Models::Experience.new(r)
1450
1522
  end
1451
1523
 
@@ -1457,18 +1529,26 @@ module Io
1457
1529
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
1458
1530
  end
1459
1531
 
1460
- def get(organization, experience_key)
1532
+ def get(organization, experience_key, incoming={})
1461
1533
  HttpClient::Preconditions.assert_class('organization', organization, String)
1462
1534
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1463
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/checkout").get
1535
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1536
+ query = {
1537
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1538
+ }.delete_if { |k, v| v.nil? }
1539
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/checkout").with_query(query).get
1464
1540
  ::Io::Flow::V0::Models::ExperienceCheckoutSettings.new(r)
1465
1541
  end
1466
1542
 
1467
- def put(organization, experience_key, experience_checkout_settings_form)
1543
+ def put(organization, experience_key, experience_checkout_settings_form, incoming={})
1468
1544
  HttpClient::Preconditions.assert_class('organization', organization, String)
1469
1545
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1546
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1547
+ query = {
1548
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1549
+ }.delete_if { |k, v| v.nil? }
1470
1550
  (x = experience_checkout_settings_form; x.is_a?(::Io::Flow::V0::Models::ExperienceCheckoutSettingsForm) ? x : ::Io::Flow::V0::Models::ExperienceCheckoutSettingsForm.new(x))
1471
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/checkout").with_json(experience_checkout_settings_form.to_json).put
1551
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/checkout").with_query(query).with_json(experience_checkout_settings_form.to_json).put
1472
1552
  ::Io::Flow::V0::Models::ExperienceCheckoutSettings.new(r)
1473
1553
  end
1474
1554
 
@@ -1485,7 +1565,8 @@ module Io
1485
1565
  HttpClient::Preconditions.assert_class('organization', organization, String)
1486
1566
  opts = HttpClient::Helper.symbolize_keys(incoming)
1487
1567
  query = {
1488
- :region_id => (x = opts.delete(:region_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('region_id', x, String))
1568
+ :region_id => (x = opts.delete(:region_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('region_id', x, String)),
1569
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1489
1570
  }.delete_if { |k, v| v.nil? }
1490
1571
  r = @client.request("/#{CGI.escape(organization)}/experience/defaults").with_query(query).get
1491
1572
  ::Io::Flow::V0::Models::ExperienceDefaults.new(r)
@@ -1506,11 +1587,15 @@ module Io
1506
1587
  ::Io::Flow::V0::Models::ExperienceLogisticsSettings.new(r)
1507
1588
  end
1508
1589
 
1509
- def put(organization, experience_key, experience_logistics_settings_put_form)
1590
+ def put(organization, experience_key, experience_logistics_settings_put_form, incoming={})
1510
1591
  HttpClient::Preconditions.assert_class('organization', organization, String)
1511
1592
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
1593
+ opts = HttpClient::Helper.symbolize_keys(incoming)
1594
+ query = {
1595
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1596
+ }.delete_if { |k, v| v.nil? }
1512
1597
  (x = experience_logistics_settings_put_form; x.is_a?(::Io::Flow::V0::Models::ExperienceLogisticsSettingsPutForm) ? x : ::Io::Flow::V0::Models::ExperienceLogisticsSettingsPutForm.new(x))
1513
- r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/logistics").with_json(experience_logistics_settings_put_form.to_json).put
1598
+ r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/logistics").with_query(query).with_json(experience_logistics_settings_put_form.to_json).put
1514
1599
  ::Io::Flow::V0::Models::ExperienceLogisticsSettings.new(r)
1515
1600
  end
1516
1601
 
@@ -1725,6 +1810,7 @@ module Io
1725
1810
  :customer_number => (x = opts.delete(:customer_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('customer_number', x, String)),
1726
1811
  :submitted_at_on_or_after => (x = opts.delete(:submitted_at_on_or_after); x.nil? ? nil : HttpClient::Preconditions.assert_class('submitted_at_on_or_after', HttpClient::Helper.to_date_time_iso8601(x), DateTime)),
1727
1812
  :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) }),
1813
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)),
1728
1814
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
1729
1815
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
1730
1816
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String),
@@ -1762,7 +1848,8 @@ module Io
1762
1848
  opts = HttpClient::Helper.symbolize_keys(incoming)
1763
1849
  query = {
1764
1850
  :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),
1765
- :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) })
1851
+ :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) }),
1852
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1766
1853
  }.delete_if { |k, v| v.nil? }
1767
1854
  r = @client.request("/#{CGI.escape(organization)}/orders/identifier/#{CGI.escape(identifier)}").with_query(query).get
1768
1855
  ::Io::Flow::V0::Models::Order.new(r)
@@ -1810,7 +1897,8 @@ module Io
1810
1897
  opts = HttpClient::Helper.symbolize_keys(incoming)
1811
1898
  query = {
1812
1899
  :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),
1813
- :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) })
1900
+ :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) }),
1901
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
1814
1902
  }.delete_if { |k, v| v.nil? }
1815
1903
  r = @client.request("/#{CGI.escape(organization)}/orders/#{CGI.escape(number)}").with_query(query).get
1816
1904
  ::Io::Flow::V0::Models::Order.new(r)
@@ -2033,7 +2121,8 @@ module Io
2033
2121
  opts = HttpClient::Helper.symbolize_keys(incoming)
2034
2122
  query = {
2035
2123
  :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),
2036
- :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) })
2124
+ :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) }),
2125
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
2037
2126
  }.delete_if { |k, v| v.nil? }
2038
2127
  r = @client.request("/#{CGI.escape(organization)}/order/builders/#{CGI.escape(number)}").with_query(query).get
2039
2128
  ::Io::Flow::V0::Models::OrderBuilder.new(r)
@@ -2231,7 +2320,8 @@ module Io
2231
2320
  opts = HttpClient::Helper.symbolize_keys(incoming)
2232
2321
  query = {
2233
2322
  :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),
2234
- :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) })
2323
+ :romanize => (x = opts.delete(:romanize); x.nil? ? nil : HttpClient::Preconditions.assert_class('romanize', x, Array).map { |v| HttpClient::Preconditions.assert_class('romanize', v, String) }),
2324
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
2235
2325
  }.delete_if { |k, v| v.nil? }
2236
2326
  r = @client.request("/#{CGI.escape(organization)}/order-estimates/#{CGI.escape(number)}").with_query(query).get
2237
2327
  ::Io::Flow::V0::Models::Experience.new(r)
@@ -2402,7 +2492,8 @@ module Io
2402
2492
  query = {
2403
2493
  :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
2404
2494
  :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)),
2405
- :status => HttpClient::Preconditions.assert_class('status', (x = opts.delete(:status); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperienceStatus) ? x : ::Io::Flow::V0::Models::ExperienceStatus.apply(x)).value }
2495
+ :status => HttpClient::Preconditions.assert_class('status', (x = opts.delete(:status); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperienceStatus) ? x : ::Io::Flow::V0::Models::ExperienceStatus.apply(x)).value },
2496
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
2406
2497
  }.delete_if { |k, v| v.nil? }
2407
2498
  r = @client.request("/#{CGI.escape(organization)}/countries").with_query(query).get
2408
2499
  r.map { |x| ::Io::Flow::V0::Models::Country.new(x) }
@@ -2531,6 +2622,7 @@ module Io
2531
2622
  :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
2532
2623
  :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
2533
2624
  :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
2625
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)),
2534
2626
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2535
2627
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2536
2628
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String)
@@ -2548,6 +2640,7 @@ module Io
2548
2640
  :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)),
2549
2641
  :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
2550
2642
  :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)),
2643
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)),
2551
2644
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2552
2645
  :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2553
2646
  :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String)
@@ -2563,7 +2656,8 @@ module Io
2563
2656
  query = {
2564
2657
  :experiences => (x = opts.delete(:experiences); x.nil? ? nil : HttpClient::Preconditions.assert_class('experiences', x, Array).map { |v| HttpClient::Preconditions.assert_class('experiences', v, String) }),
2565
2658
  :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2566
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer)
2659
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2660
+ :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
2567
2661
  }.delete_if { |k, v| v.nil? }
2568
2662
  r = @client.request("/#{CGI.escape(organization)}/payment/method/rules/batch").with_query(query).get
2569
2663
  r.map { |x| ::Io::Flow::V0::Models::ExperiencePaymentMethodRule.new(x) }
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.2.87
4
+ version: 0.2.88
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: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -54,7 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.0.3
57
+ rubyforge_project:
58
+ rubygems_version: 2.5.2.3
58
59
  signing_key:
59
60
  specification_version: 4
60
61
  summary: Native ruby client for the Flow REST API.