square.rb 6.2.0.20200812 → 8.0.0.20201216

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -33
  3. data/lib/square.rb +61 -62
  4. data/lib/square/api/apple_pay_api.rb +5 -3
  5. data/lib/square/api/bank_accounts_api.rb +16 -19
  6. data/lib/square/api/base_api.rb +1 -1
  7. data/lib/square/api/bookings_api.rb +308 -0
  8. data/lib/square/api/cash_drawers_api.rb +13 -6
  9. data/lib/square/api/catalog_api.rb +68 -32
  10. data/lib/square/api/checkout_api.rb +4 -2
  11. data/lib/square/api/customer_groups_api.rb +18 -8
  12. data/lib/square/api/customer_segments_api.rb +9 -5
  13. data/lib/square/api/customers_api.rb +47 -27
  14. data/lib/square/api/devices_api.rb +17 -6
  15. data/lib/square/api/disputes_api.rb +71 -68
  16. data/lib/square/api/employees_api.rb +10 -5
  17. data/lib/square/api/inventory_api.rb +30 -15
  18. data/lib/square/api/invoices_api.rb +42 -38
  19. data/lib/square/api/labor_api.rb +131 -22
  20. data/lib/square/api/locations_api.rb +16 -13
  21. data/lib/square/api/loyalty_api.rb +60 -66
  22. data/lib/square/api/merchants_api.rb +7 -3
  23. data/lib/square/api/mobile_authorization_api.rb +5 -3
  24. data/lib/square/api/o_auth_api.rb +11 -8
  25. data/lib/square/api/orders_api.rb +111 -90
  26. data/lib/square/api/payments_api.rb +75 -65
  27. data/lib/square/api/refunds_api.rb +37 -27
  28. data/lib/square/api/subscriptions_api.rb +29 -28
  29. data/lib/square/api/team_api.rb +46 -30
  30. data/lib/square/api/terminal_api.rb +156 -7
  31. data/lib/square/api/transactions_api.rb +32 -18
  32. data/lib/square/api/v1_employees_api.rb +59 -31
  33. data/lib/square/api/v1_items_api.rb +195 -115
  34. data/lib/square/api/v1_transactions_api.rb +49 -27
  35. data/lib/square/api_helper.rb +14 -9
  36. data/lib/square/client.rb +14 -20
  37. data/lib/square/configuration.rb +2 -2
  38. data/lib/square/http/api_response.rb +2 -0
  39. data/lib/square/http/faraday_client.rb +9 -2
  40. data/spec/user_journey_spec.rb +2 -5
  41. data/test/api/api_test_base.rb +1 -6
  42. data/test/api/test_catalog_api.rb +1 -4
  43. data/test/api/test_customers_api.rb +1 -4
  44. data/test/api/test_employees_api.rb +1 -4
  45. data/test/api/test_labor_api.rb +2 -6
  46. data/test/api/test_locations_api.rb +22 -33
  47. data/test/api/test_merchants_api.rb +1 -4
  48. data/test/api/test_payments_api.rb +3 -6
  49. data/test/api/test_refunds_api.rb +3 -6
  50. data/test/http_response_catcher.rb +0 -5
  51. data/test/test_helper.rb +0 -5
  52. metadata +33 -16
  53. data/lib/square/api/reporting_api.rb +0 -138
  54. data/lib/square/api/v1_locations_api.rb +0 -65
@@ -16,7 +16,7 @@ module Square
16
16
  _query_builder << '/v1/{location_id}/categories'
17
17
  _query_builder = APIHelper.append_url_with_template_parameters(
18
18
  _query_builder,
19
- 'location_id' => location_id
19
+ 'location_id' => { 'value' => location_id, 'encode' => true }
20
20
  )
21
21
  _query_url = APIHelper.clean_url _query_builder
22
22
 
@@ -36,7 +36,9 @@ module Square
36
36
  # Return appropriate response type.
37
37
  decoded = APIHelper.json_deserialize(_response.raw_body)
38
38
  _errors = APIHelper.map_response(decoded, ['errors'])
39
- ApiResponse.new(_response, data: decoded, errors: _errors)
39
+ ApiResponse.new(
40
+ _response, data: decoded, errors: _errors
41
+ )
40
42
  end
41
43
 
42
44
  # Creates an item category.
@@ -54,7 +56,7 @@ module Square
54
56
  _query_builder << '/v1/{location_id}/categories'
55
57
  _query_builder = APIHelper.append_url_with_template_parameters(
56
58
  _query_builder,
57
- 'location_id' => location_id
59
+ 'location_id' => { 'value' => location_id, 'encode' => true }
58
60
  )
59
61
  _query_url = APIHelper.clean_url _query_builder
60
62
 
@@ -76,7 +78,9 @@ module Square
76
78
  # Return appropriate response type.
77
79
  decoded = APIHelper.json_deserialize(_response.raw_body)
78
80
  _errors = APIHelper.map_response(decoded, ['errors'])
79
- ApiResponse.new(_response, data: decoded, errors: _errors)
81
+ ApiResponse.new(
82
+ _response, data: decoded, errors: _errors
83
+ )
80
84
  end
81
85
 
82
86
  # Deletes an existing item category.
@@ -96,8 +100,8 @@ module Square
96
100
  _query_builder << '/v1/{location_id}/categories/{category_id}'
97
101
  _query_builder = APIHelper.append_url_with_template_parameters(
98
102
  _query_builder,
99
- 'location_id' => location_id,
100
- 'category_id' => category_id
103
+ 'location_id' => { 'value' => location_id, 'encode' => true },
104
+ 'category_id' => { 'value' => category_id, 'encode' => true }
101
105
  )
102
106
  _query_url = APIHelper.clean_url _query_builder
103
107
 
@@ -117,7 +121,9 @@ module Square
117
121
  # Return appropriate response type.
118
122
  decoded = APIHelper.json_deserialize(_response.raw_body)
119
123
  _errors = APIHelper.map_response(decoded, ['errors'])
120
- ApiResponse.new(_response, data: decoded, errors: _errors)
124
+ ApiResponse.new(
125
+ _response, data: decoded, errors: _errors
126
+ )
121
127
  end
122
128
 
123
129
  # Modifies the details of an existing item category.
@@ -138,8 +144,8 @@ module Square
138
144
  _query_builder << '/v1/{location_id}/categories/{category_id}'
139
145
  _query_builder = APIHelper.append_url_with_template_parameters(
140
146
  _query_builder,
141
- 'location_id' => location_id,
142
- 'category_id' => category_id
147
+ 'location_id' => { 'value' => location_id, 'encode' => true },
148
+ 'category_id' => { 'value' => category_id, 'encode' => true }
143
149
  )
144
150
  _query_url = APIHelper.clean_url _query_builder
145
151
 
@@ -161,7 +167,9 @@ module Square
161
167
  # Return appropriate response type.
162
168
  decoded = APIHelper.json_deserialize(_response.raw_body)
163
169
  _errors = APIHelper.map_response(decoded, ['errors'])
164
- ApiResponse.new(_response, data: decoded, errors: _errors)
170
+ ApiResponse.new(
171
+ _response, data: decoded, errors: _errors
172
+ )
165
173
  end
166
174
 
167
175
  # Lists all the discounts for a given location.
@@ -175,7 +183,7 @@ module Square
175
183
  _query_builder << '/v1/{location_id}/discounts'
176
184
  _query_builder = APIHelper.append_url_with_template_parameters(
177
185
  _query_builder,
178
- 'location_id' => location_id
186
+ 'location_id' => { 'value' => location_id, 'encode' => true }
179
187
  )
180
188
  _query_url = APIHelper.clean_url _query_builder
181
189
 
@@ -195,7 +203,9 @@ module Square
195
203
  # Return appropriate response type.
196
204
  decoded = APIHelper.json_deserialize(_response.raw_body)
197
205
  _errors = APIHelper.map_response(decoded, ['errors'])
198
- ApiResponse.new(_response, data: decoded, errors: _errors)
206
+ ApiResponse.new(
207
+ _response, data: decoded, errors: _errors
208
+ )
199
209
  end
200
210
 
201
211
  # Creates a discount.
@@ -213,7 +223,7 @@ module Square
213
223
  _query_builder << '/v1/{location_id}/discounts'
214
224
  _query_builder = APIHelper.append_url_with_template_parameters(
215
225
  _query_builder,
216
- 'location_id' => location_id
226
+ 'location_id' => { 'value' => location_id, 'encode' => true }
217
227
  )
218
228
  _query_url = APIHelper.clean_url _query_builder
219
229
 
@@ -235,7 +245,9 @@ module Square
235
245
  # Return appropriate response type.
236
246
  decoded = APIHelper.json_deserialize(_response.raw_body)
237
247
  _errors = APIHelper.map_response(decoded, ['errors'])
238
- ApiResponse.new(_response, data: decoded, errors: _errors)
248
+ ApiResponse.new(
249
+ _response, data: decoded, errors: _errors
250
+ )
239
251
  end
240
252
 
241
253
  # Deletes an existing discount.
@@ -255,8 +267,8 @@ module Square
255
267
  _query_builder << '/v1/{location_id}/discounts/{discount_id}'
256
268
  _query_builder = APIHelper.append_url_with_template_parameters(
257
269
  _query_builder,
258
- 'location_id' => location_id,
259
- 'discount_id' => discount_id
270
+ 'location_id' => { 'value' => location_id, 'encode' => true },
271
+ 'discount_id' => { 'value' => discount_id, 'encode' => true }
260
272
  )
261
273
  _query_url = APIHelper.clean_url _query_builder
262
274
 
@@ -276,7 +288,9 @@ module Square
276
288
  # Return appropriate response type.
277
289
  decoded = APIHelper.json_deserialize(_response.raw_body)
278
290
  _errors = APIHelper.map_response(decoded, ['errors'])
279
- ApiResponse.new(_response, data: decoded, errors: _errors)
291
+ ApiResponse.new(
292
+ _response, data: decoded, errors: _errors
293
+ )
280
294
  end
281
295
 
282
296
  # Modifies the details of an existing discount.
@@ -297,8 +311,8 @@ module Square
297
311
  _query_builder << '/v1/{location_id}/discounts/{discount_id}'
298
312
  _query_builder = APIHelper.append_url_with_template_parameters(
299
313
  _query_builder,
300
- 'location_id' => location_id,
301
- 'discount_id' => discount_id
314
+ 'location_id' => { 'value' => location_id, 'encode' => true },
315
+ 'discount_id' => { 'value' => discount_id, 'encode' => true }
302
316
  )
303
317
  _query_url = APIHelper.clean_url _query_builder
304
318
 
@@ -320,7 +334,9 @@ module Square
320
334
  # Return appropriate response type.
321
335
  decoded = APIHelper.json_deserialize(_response.raw_body)
322
336
  _errors = APIHelper.map_response(decoded, ['errors'])
323
- ApiResponse.new(_response, data: decoded, errors: _errors)
337
+ ApiResponse.new(
338
+ _response, data: decoded, errors: _errors
339
+ )
324
340
  end
325
341
 
326
342
  # Lists all the fees (taxes) for a given location.
@@ -334,7 +350,7 @@ module Square
334
350
  _query_builder << '/v1/{location_id}/fees'
335
351
  _query_builder = APIHelper.append_url_with_template_parameters(
336
352
  _query_builder,
337
- 'location_id' => location_id
353
+ 'location_id' => { 'value' => location_id, 'encode' => true }
338
354
  )
339
355
  _query_url = APIHelper.clean_url _query_builder
340
356
 
@@ -354,7 +370,9 @@ module Square
354
370
  # Return appropriate response type.
355
371
  decoded = APIHelper.json_deserialize(_response.raw_body)
356
372
  _errors = APIHelper.map_response(decoded, ['errors'])
357
- ApiResponse.new(_response, data: decoded, errors: _errors)
373
+ ApiResponse.new(
374
+ _response, data: decoded, errors: _errors
375
+ )
358
376
  end
359
377
 
360
378
  # Creates a fee (tax).
@@ -372,7 +390,7 @@ module Square
372
390
  _query_builder << '/v1/{location_id}/fees'
373
391
  _query_builder = APIHelper.append_url_with_template_parameters(
374
392
  _query_builder,
375
- 'location_id' => location_id
393
+ 'location_id' => { 'value' => location_id, 'encode' => true }
376
394
  )
377
395
  _query_url = APIHelper.clean_url _query_builder
378
396
 
@@ -394,7 +412,9 @@ module Square
394
412
  # Return appropriate response type.
395
413
  decoded = APIHelper.json_deserialize(_response.raw_body)
396
414
  _errors = APIHelper.map_response(decoded, ['errors'])
397
- ApiResponse.new(_response, data: decoded, errors: _errors)
415
+ ApiResponse.new(
416
+ _response, data: decoded, errors: _errors
417
+ )
398
418
  end
399
419
 
400
420
  # Deletes an existing fee (tax).
@@ -413,8 +433,8 @@ module Square
413
433
  _query_builder << '/v1/{location_id}/fees/{fee_id}'
414
434
  _query_builder = APIHelper.append_url_with_template_parameters(
415
435
  _query_builder,
416
- 'location_id' => location_id,
417
- 'fee_id' => fee_id
436
+ 'location_id' => { 'value' => location_id, 'encode' => true },
437
+ 'fee_id' => { 'value' => fee_id, 'encode' => true }
418
438
  )
419
439
  _query_url = APIHelper.clean_url _query_builder
420
440
 
@@ -434,7 +454,9 @@ module Square
434
454
  # Return appropriate response type.
435
455
  decoded = APIHelper.json_deserialize(_response.raw_body)
436
456
  _errors = APIHelper.map_response(decoded, ['errors'])
437
- ApiResponse.new(_response, data: decoded, errors: _errors)
457
+ ApiResponse.new(
458
+ _response, data: decoded, errors: _errors
459
+ )
438
460
  end
439
461
 
440
462
  # Modifies the details of an existing fee (tax).
@@ -454,8 +476,8 @@ module Square
454
476
  _query_builder << '/v1/{location_id}/fees/{fee_id}'
455
477
  _query_builder = APIHelper.append_url_with_template_parameters(
456
478
  _query_builder,
457
- 'location_id' => location_id,
458
- 'fee_id' => fee_id
479
+ 'location_id' => { 'value' => location_id, 'encode' => true },
480
+ 'fee_id' => { 'value' => fee_id, 'encode' => true }
459
481
  )
460
482
  _query_url = APIHelper.clean_url _query_builder
461
483
 
@@ -477,7 +499,9 @@ module Square
477
499
  # Return appropriate response type.
478
500
  decoded = APIHelper.json_deserialize(_response.raw_body)
479
501
  _errors = APIHelper.map_response(decoded, ['errors'])
480
- ApiResponse.new(_response, data: decoded, errors: _errors)
502
+ ApiResponse.new(
503
+ _response, data: decoded, errors: _errors
504
+ )
481
505
  end
482
506
 
483
507
  # Provides inventory information for all inventory-enabled item
@@ -499,7 +523,7 @@ module Square
499
523
  _query_builder << '/v1/{location_id}/inventory'
500
524
  _query_builder = APIHelper.append_url_with_template_parameters(
501
525
  _query_builder,
502
- 'location_id' => location_id
526
+ 'location_id' => { 'value' => location_id, 'encode' => true }
503
527
  )
504
528
  _query_builder = APIHelper.append_url_with_query_parameters(
505
529
  _query_builder,
@@ -524,7 +548,9 @@ module Square
524
548
  # Return appropriate response type.
525
549
  decoded = APIHelper.json_deserialize(_response.raw_body)
526
550
  _errors = APIHelper.map_response(decoded, ['errors'])
527
- ApiResponse.new(_response, data: decoded, errors: _errors)
551
+ ApiResponse.new(
552
+ _response, data: decoded, errors: _errors
553
+ )
528
554
  end
529
555
 
530
556
  # Adjusts the current available inventory of an item variation.
@@ -545,8 +571,8 @@ module Square
545
571
  _query_builder << '/v1/{location_id}/inventory/{variation_id}'
546
572
  _query_builder = APIHelper.append_url_with_template_parameters(
547
573
  _query_builder,
548
- 'location_id' => location_id,
549
- 'variation_id' => variation_id
574
+ 'location_id' => { 'value' => location_id, 'encode' => true },
575
+ 'variation_id' => { 'value' => variation_id, 'encode' => true }
550
576
  )
551
577
  _query_url = APIHelper.clean_url _query_builder
552
578
 
@@ -568,7 +594,9 @@ module Square
568
594
  # Return appropriate response type.
569
595
  decoded = APIHelper.json_deserialize(_response.raw_body)
570
596
  _errors = APIHelper.map_response(decoded, ['errors'])
571
- ApiResponse.new(_response, data: decoded, errors: _errors)
597
+ ApiResponse.new(
598
+ _response, data: decoded, errors: _errors
599
+ )
572
600
  end
573
601
 
574
602
  # Provides summary information of all items for a given location.
@@ -586,7 +614,7 @@ module Square
586
614
  _query_builder << '/v1/{location_id}/items'
587
615
  _query_builder = APIHelper.append_url_with_template_parameters(
588
616
  _query_builder,
589
- 'location_id' => location_id
617
+ 'location_id' => { 'value' => location_id, 'encode' => true }
590
618
  )
591
619
  _query_builder = APIHelper.append_url_with_query_parameters(
592
620
  _query_builder,
@@ -610,7 +638,9 @@ module Square
610
638
  # Return appropriate response type.
611
639
  decoded = APIHelper.json_deserialize(_response.raw_body)
612
640
  _errors = APIHelper.map_response(decoded, ['errors'])
613
- ApiResponse.new(_response, data: decoded, errors: _errors)
641
+ ApiResponse.new(
642
+ _response, data: decoded, errors: _errors
643
+ )
614
644
  end
615
645
 
616
646
  # Creates an item and at least one variation for it.
@@ -638,7 +668,7 @@ module Square
638
668
  _query_builder << '/v1/{location_id}/items'
639
669
  _query_builder = APIHelper.append_url_with_template_parameters(
640
670
  _query_builder,
641
- 'location_id' => location_id
671
+ 'location_id' => { 'value' => location_id, 'encode' => true }
642
672
  )
643
673
  _query_url = APIHelper.clean_url _query_builder
644
674
 
@@ -660,7 +690,9 @@ module Square
660
690
  # Return appropriate response type.
661
691
  decoded = APIHelper.json_deserialize(_response.raw_body)
662
692
  _errors = APIHelper.map_response(decoded, ['errors'])
663
- ApiResponse.new(_response, data: decoded, errors: _errors)
693
+ ApiResponse.new(
694
+ _response, data: decoded, errors: _errors
695
+ )
664
696
  end
665
697
 
666
698
  # Deletes an existing item and all item variations associated with it.
@@ -680,8 +712,8 @@ module Square
680
712
  _query_builder << '/v1/{location_id}/items/{item_id}'
681
713
  _query_builder = APIHelper.append_url_with_template_parameters(
682
714
  _query_builder,
683
- 'location_id' => location_id,
684
- 'item_id' => item_id
715
+ 'location_id' => { 'value' => location_id, 'encode' => true },
716
+ 'item_id' => { 'value' => item_id, 'encode' => true }
685
717
  )
686
718
  _query_url = APIHelper.clean_url _query_builder
687
719
 
@@ -701,7 +733,9 @@ module Square
701
733
  # Return appropriate response type.
702
734
  decoded = APIHelper.json_deserialize(_response.raw_body)
703
735
  _errors = APIHelper.map_response(decoded, ['errors'])
704
- ApiResponse.new(_response, data: decoded, errors: _errors)
736
+ ApiResponse.new(
737
+ _response, data: decoded, errors: _errors
738
+ )
705
739
  end
706
740
 
707
741
  # Provides the details for a single item, including associated modifier
@@ -718,8 +752,8 @@ module Square
718
752
  _query_builder << '/v1/{location_id}/items/{item_id}'
719
753
  _query_builder = APIHelper.append_url_with_template_parameters(
720
754
  _query_builder,
721
- 'location_id' => location_id,
722
- 'item_id' => item_id
755
+ 'location_id' => { 'value' => location_id, 'encode' => true },
756
+ 'item_id' => { 'value' => item_id, 'encode' => true }
723
757
  )
724
758
  _query_url = APIHelper.clean_url _query_builder
725
759
 
@@ -739,7 +773,9 @@ module Square
739
773
  # Return appropriate response type.
740
774
  decoded = APIHelper.json_deserialize(_response.raw_body)
741
775
  _errors = APIHelper.map_response(decoded, ['errors'])
742
- ApiResponse.new(_response, data: decoded, errors: _errors)
776
+ ApiResponse.new(
777
+ _response, data: decoded, errors: _errors
778
+ )
743
779
  end
744
780
 
745
781
  # Modifies the core details of an existing item.
@@ -760,8 +796,8 @@ module Square
760
796
  _query_builder << '/v1/{location_id}/items/{item_id}'
761
797
  _query_builder = APIHelper.append_url_with_template_parameters(
762
798
  _query_builder,
763
- 'location_id' => location_id,
764
- 'item_id' => item_id
799
+ 'location_id' => { 'value' => location_id, 'encode' => true },
800
+ 'item_id' => { 'value' => item_id, 'encode' => true }
765
801
  )
766
802
  _query_url = APIHelper.clean_url _query_builder
767
803
 
@@ -783,7 +819,9 @@ module Square
783
819
  # Return appropriate response type.
784
820
  decoded = APIHelper.json_deserialize(_response.raw_body)
785
821
  _errors = APIHelper.map_response(decoded, ['errors'])
786
- ApiResponse.new(_response, data: decoded, errors: _errors)
822
+ ApiResponse.new(
823
+ _response, data: decoded, errors: _errors
824
+ )
787
825
  end
788
826
 
789
827
  # Removes a fee assocation from an item so the fee is no longer
@@ -803,9 +841,9 @@ module Square
803
841
  _query_builder << '/v1/{location_id}/items/{item_id}/fees/{fee_id}'
804
842
  _query_builder = APIHelper.append_url_with_template_parameters(
805
843
  _query_builder,
806
- 'location_id' => location_id,
807
- 'item_id' => item_id,
808
- 'fee_id' => fee_id
844
+ 'location_id' => { 'value' => location_id, 'encode' => true },
845
+ 'item_id' => { 'value' => item_id, 'encode' => true },
846
+ 'fee_id' => { 'value' => fee_id, 'encode' => true }
809
847
  )
810
848
  _query_url = APIHelper.clean_url _query_builder
811
849
 
@@ -825,7 +863,9 @@ module Square
825
863
  # Return appropriate response type.
826
864
  decoded = APIHelper.json_deserialize(_response.raw_body)
827
865
  _errors = APIHelper.map_response(decoded, ['errors'])
828
- ApiResponse.new(_response, data: decoded, errors: _errors)
866
+ ApiResponse.new(
867
+ _response, data: decoded, errors: _errors
868
+ )
829
869
  end
830
870
 
831
871
  # Associates a fee with an item so the fee is automatically applied to
@@ -845,9 +885,9 @@ module Square
845
885
  _query_builder << '/v1/{location_id}/items/{item_id}/fees/{fee_id}'
846
886
  _query_builder = APIHelper.append_url_with_template_parameters(
847
887
  _query_builder,
848
- 'location_id' => location_id,
849
- 'item_id' => item_id,
850
- 'fee_id' => fee_id
888
+ 'location_id' => { 'value' => location_id, 'encode' => true },
889
+ 'item_id' => { 'value' => item_id, 'encode' => true },
890
+ 'fee_id' => { 'value' => fee_id, 'encode' => true }
851
891
  )
852
892
  _query_url = APIHelper.clean_url _query_builder
853
893
 
@@ -867,7 +907,9 @@ module Square
867
907
  # Return appropriate response type.
868
908
  decoded = APIHelper.json_deserialize(_response.raw_body)
869
909
  _errors = APIHelper.map_response(decoded, ['errors'])
870
- ApiResponse.new(_response, data: decoded, errors: _errors)
910
+ ApiResponse.new(
911
+ _response, data: decoded, errors: _errors
912
+ )
871
913
  end
872
914
 
873
915
  # Removes a modifier list association from an item so the modifier
@@ -888,9 +930,9 @@ module Square
888
930
  _query_builder << '/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}'
889
931
  _query_builder = APIHelper.append_url_with_template_parameters(
890
932
  _query_builder,
891
- 'location_id' => location_id,
892
- 'modifier_list_id' => modifier_list_id,
893
- 'item_id' => item_id
933
+ 'location_id' => { 'value' => location_id, 'encode' => true },
934
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true },
935
+ 'item_id' => { 'value' => item_id, 'encode' => true }
894
936
  )
895
937
  _query_url = APIHelper.clean_url _query_builder
896
938
 
@@ -910,7 +952,9 @@ module Square
910
952
  # Return appropriate response type.
911
953
  decoded = APIHelper.json_deserialize(_response.raw_body)
912
954
  _errors = APIHelper.map_response(decoded, ['errors'])
913
- ApiResponse.new(_response, data: decoded, errors: _errors)
955
+ ApiResponse.new(
956
+ _response, data: decoded, errors: _errors
957
+ )
914
958
  end
915
959
 
916
960
  # Associates a modifier list with an item so the associated modifier
@@ -931,9 +975,9 @@ module Square
931
975
  _query_builder << '/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}'
932
976
  _query_builder = APIHelper.append_url_with_template_parameters(
933
977
  _query_builder,
934
- 'location_id' => location_id,
935
- 'modifier_list_id' => modifier_list_id,
936
- 'item_id' => item_id
978
+ 'location_id' => { 'value' => location_id, 'encode' => true },
979
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true },
980
+ 'item_id' => { 'value' => item_id, 'encode' => true }
937
981
  )
938
982
  _query_url = APIHelper.clean_url _query_builder
939
983
 
@@ -953,7 +997,9 @@ module Square
953
997
  # Return appropriate response type.
954
998
  decoded = APIHelper.json_deserialize(_response.raw_body)
955
999
  _errors = APIHelper.map_response(decoded, ['errors'])
956
- ApiResponse.new(_response, data: decoded, errors: _errors)
1000
+ ApiResponse.new(
1001
+ _response, data: decoded, errors: _errors
1002
+ )
957
1003
  end
958
1004
 
959
1005
  # Creates an item variation for an existing item.
@@ -973,8 +1019,8 @@ module Square
973
1019
  _query_builder << '/v1/{location_id}/items/{item_id}/variations'
974
1020
  _query_builder = APIHelper.append_url_with_template_parameters(
975
1021
  _query_builder,
976
- 'location_id' => location_id,
977
- 'item_id' => item_id
1022
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1023
+ 'item_id' => { 'value' => item_id, 'encode' => true }
978
1024
  )
979
1025
  _query_url = APIHelper.clean_url _query_builder
980
1026
 
@@ -996,7 +1042,9 @@ module Square
996
1042
  # Return appropriate response type.
997
1043
  decoded = APIHelper.json_deserialize(_response.raw_body)
998
1044
  _errors = APIHelper.map_response(decoded, ['errors'])
999
- ApiResponse.new(_response, data: decoded, errors: _errors)
1045
+ ApiResponse.new(
1046
+ _response, data: decoded, errors: _errors
1047
+ )
1000
1048
  end
1001
1049
 
1002
1050
  # Deletes an existing item variation from an item.
@@ -1019,9 +1067,9 @@ module Square
1019
1067
  _query_builder << '/v1/{location_id}/items/{item_id}/variations/{variation_id}'
1020
1068
  _query_builder = APIHelper.append_url_with_template_parameters(
1021
1069
  _query_builder,
1022
- 'location_id' => location_id,
1023
- 'item_id' => item_id,
1024
- 'variation_id' => variation_id
1070
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1071
+ 'item_id' => { 'value' => item_id, 'encode' => true },
1072
+ 'variation_id' => { 'value' => variation_id, 'encode' => true }
1025
1073
  )
1026
1074
  _query_url = APIHelper.clean_url _query_builder
1027
1075
 
@@ -1041,7 +1089,9 @@ module Square
1041
1089
  # Return appropriate response type.
1042
1090
  decoded = APIHelper.json_deserialize(_response.raw_body)
1043
1091
  _errors = APIHelper.map_response(decoded, ['errors'])
1044
- ApiResponse.new(_response, data: decoded, errors: _errors)
1092
+ ApiResponse.new(
1093
+ _response, data: decoded, errors: _errors
1094
+ )
1045
1095
  end
1046
1096
 
1047
1097
  # Modifies the details of an existing item variation.
@@ -1065,9 +1115,9 @@ module Square
1065
1115
  _query_builder << '/v1/{location_id}/items/{item_id}/variations/{variation_id}'
1066
1116
  _query_builder = APIHelper.append_url_with_template_parameters(
1067
1117
  _query_builder,
1068
- 'location_id' => location_id,
1069
- 'item_id' => item_id,
1070
- 'variation_id' => variation_id
1118
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1119
+ 'item_id' => { 'value' => item_id, 'encode' => true },
1120
+ 'variation_id' => { 'value' => variation_id, 'encode' => true }
1071
1121
  )
1072
1122
  _query_url = APIHelper.clean_url _query_builder
1073
1123
 
@@ -1089,7 +1139,9 @@ module Square
1089
1139
  # Return appropriate response type.
1090
1140
  decoded = APIHelper.json_deserialize(_response.raw_body)
1091
1141
  _errors = APIHelper.map_response(decoded, ['errors'])
1092
- ApiResponse.new(_response, data: decoded, errors: _errors)
1142
+ ApiResponse.new(
1143
+ _response, data: decoded, errors: _errors
1144
+ )
1093
1145
  end
1094
1146
 
1095
1147
  # Lists all the modifier lists for a given location.
@@ -1103,7 +1155,7 @@ module Square
1103
1155
  _query_builder << '/v1/{location_id}/modifier-lists'
1104
1156
  _query_builder = APIHelper.append_url_with_template_parameters(
1105
1157
  _query_builder,
1106
- 'location_id' => location_id
1158
+ 'location_id' => { 'value' => location_id, 'encode' => true }
1107
1159
  )
1108
1160
  _query_url = APIHelper.clean_url _query_builder
1109
1161
 
@@ -1123,7 +1175,9 @@ module Square
1123
1175
  # Return appropriate response type.
1124
1176
  decoded = APIHelper.json_deserialize(_response.raw_body)
1125
1177
  _errors = APIHelper.map_response(decoded, ['errors'])
1126
- ApiResponse.new(_response, data: decoded, errors: _errors)
1178
+ ApiResponse.new(
1179
+ _response, data: decoded, errors: _errors
1180
+ )
1127
1181
  end
1128
1182
 
1129
1183
  # Creates an item modifier list and at least 1 modifier option for it.
@@ -1141,7 +1195,7 @@ module Square
1141
1195
  _query_builder << '/v1/{location_id}/modifier-lists'
1142
1196
  _query_builder = APIHelper.append_url_with_template_parameters(
1143
1197
  _query_builder,
1144
- 'location_id' => location_id
1198
+ 'location_id' => { 'value' => location_id, 'encode' => true }
1145
1199
  )
1146
1200
  _query_url = APIHelper.clean_url _query_builder
1147
1201
 
@@ -1163,7 +1217,9 @@ module Square
1163
1217
  # Return appropriate response type.
1164
1218
  decoded = APIHelper.json_deserialize(_response.raw_body)
1165
1219
  _errors = APIHelper.map_response(decoded, ['errors'])
1166
- ApiResponse.new(_response, data: decoded, errors: _errors)
1220
+ ApiResponse.new(
1221
+ _response, data: decoded, errors: _errors
1222
+ )
1167
1223
  end
1168
1224
 
1169
1225
  # Deletes an existing item modifier list and all modifier options
@@ -1184,8 +1240,8 @@ module Square
1184
1240
  _query_builder << '/v1/{location_id}/modifier-lists/{modifier_list_id}'
1185
1241
  _query_builder = APIHelper.append_url_with_template_parameters(
1186
1242
  _query_builder,
1187
- 'location_id' => location_id,
1188
- 'modifier_list_id' => modifier_list_id
1243
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1244
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true }
1189
1245
  )
1190
1246
  _query_url = APIHelper.clean_url _query_builder
1191
1247
 
@@ -1205,7 +1261,9 @@ module Square
1205
1261
  # Return appropriate response type.
1206
1262
  decoded = APIHelper.json_deserialize(_response.raw_body)
1207
1263
  _errors = APIHelper.map_response(decoded, ['errors'])
1208
- ApiResponse.new(_response, data: decoded, errors: _errors)
1264
+ ApiResponse.new(
1265
+ _response, data: decoded, errors: _errors
1266
+ )
1209
1267
  end
1210
1268
 
1211
1269
  # Provides the details for a single modifier list.
@@ -1222,8 +1280,8 @@ module Square
1222
1280
  _query_builder << '/v1/{location_id}/modifier-lists/{modifier_list_id}'
1223
1281
  _query_builder = APIHelper.append_url_with_template_parameters(
1224
1282
  _query_builder,
1225
- 'location_id' => location_id,
1226
- 'modifier_list_id' => modifier_list_id
1283
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1284
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true }
1227
1285
  )
1228
1286
  _query_url = APIHelper.clean_url _query_builder
1229
1287
 
@@ -1243,7 +1301,9 @@ module Square
1243
1301
  # Return appropriate response type.
1244
1302
  decoded = APIHelper.json_deserialize(_response.raw_body)
1245
1303
  _errors = APIHelper.map_response(decoded, ['errors'])
1246
- ApiResponse.new(_response, data: decoded, errors: _errors)
1304
+ ApiResponse.new(
1305
+ _response, data: decoded, errors: _errors
1306
+ )
1247
1307
  end
1248
1308
 
1249
1309
  # Modifies the details of an existing item modifier list.
@@ -1264,8 +1324,8 @@ module Square
1264
1324
  _query_builder << '/v1/{location_id}/modifier-lists/{modifier_list_id}'
1265
1325
  _query_builder = APIHelper.append_url_with_template_parameters(
1266
1326
  _query_builder,
1267
- 'location_id' => location_id,
1268
- 'modifier_list_id' => modifier_list_id
1327
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1328
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true }
1269
1329
  )
1270
1330
  _query_url = APIHelper.clean_url _query_builder
1271
1331
 
@@ -1287,7 +1347,9 @@ module Square
1287
1347
  # Return appropriate response type.
1288
1348
  decoded = APIHelper.json_deserialize(_response.raw_body)
1289
1349
  _errors = APIHelper.map_response(decoded, ['errors'])
1290
- ApiResponse.new(_response, data: decoded, errors: _errors)
1350
+ ApiResponse.new(
1351
+ _response, data: decoded, errors: _errors
1352
+ )
1291
1353
  end
1292
1354
 
1293
1355
  # Creates an item modifier option and adds it to a modifier list.
@@ -1308,8 +1370,8 @@ module Square
1308
1370
  _query_builder << '/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options'
1309
1371
  _query_builder = APIHelper.append_url_with_template_parameters(
1310
1372
  _query_builder,
1311
- 'location_id' => location_id,
1312
- 'modifier_list_id' => modifier_list_id
1373
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1374
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true }
1313
1375
  )
1314
1376
  _query_url = APIHelper.clean_url _query_builder
1315
1377
 
@@ -1331,7 +1393,9 @@ module Square
1331
1393
  # Return appropriate response type.
1332
1394
  decoded = APIHelper.json_deserialize(_response.raw_body)
1333
1395
  _errors = APIHelper.map_response(decoded, ['errors'])
1334
- ApiResponse.new(_response, data: decoded, errors: _errors)
1396
+ ApiResponse.new(
1397
+ _response, data: decoded, errors: _errors
1398
+ )
1335
1399
  end
1336
1400
 
1337
1401
  # Deletes an existing item modifier option from a modifier list.
@@ -1354,9 +1418,9 @@ module Square
1354
1418
  _query_builder << '/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}'
1355
1419
  _query_builder = APIHelper.append_url_with_template_parameters(
1356
1420
  _query_builder,
1357
- 'location_id' => location_id,
1358
- 'modifier_list_id' => modifier_list_id,
1359
- 'modifier_option_id' => modifier_option_id
1421
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1422
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true },
1423
+ 'modifier_option_id' => { 'value' => modifier_option_id, 'encode' => true }
1360
1424
  )
1361
1425
  _query_url = APIHelper.clean_url _query_builder
1362
1426
 
@@ -1376,7 +1440,9 @@ module Square
1376
1440
  # Return appropriate response type.
1377
1441
  decoded = APIHelper.json_deserialize(_response.raw_body)
1378
1442
  _errors = APIHelper.map_response(decoded, ['errors'])
1379
- ApiResponse.new(_response, data: decoded, errors: _errors)
1443
+ ApiResponse.new(
1444
+ _response, data: decoded, errors: _errors
1445
+ )
1380
1446
  end
1381
1447
 
1382
1448
  # Modifies the details of an existing item modifier option.
@@ -1400,9 +1466,9 @@ module Square
1400
1466
  _query_builder << '/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}'
1401
1467
  _query_builder = APIHelper.append_url_with_template_parameters(
1402
1468
  _query_builder,
1403
- 'location_id' => location_id,
1404
- 'modifier_list_id' => modifier_list_id,
1405
- 'modifier_option_id' => modifier_option_id
1469
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1470
+ 'modifier_list_id' => { 'value' => modifier_list_id, 'encode' => true },
1471
+ 'modifier_option_id' => { 'value' => modifier_option_id, 'encode' => true }
1406
1472
  )
1407
1473
  _query_url = APIHelper.clean_url _query_builder
1408
1474
 
@@ -1424,7 +1490,9 @@ module Square
1424
1490
  # Return appropriate response type.
1425
1491
  decoded = APIHelper.json_deserialize(_response.raw_body)
1426
1492
  _errors = APIHelper.map_response(decoded, ['errors'])
1427
- ApiResponse.new(_response, data: decoded, errors: _errors)
1493
+ ApiResponse.new(
1494
+ _response, data: decoded, errors: _errors
1495
+ )
1428
1496
  end
1429
1497
 
1430
1498
  # Lists all Favorites pages (in Square Point of Sale) for a given
@@ -1439,7 +1507,7 @@ module Square
1439
1507
  _query_builder << '/v1/{location_id}/pages'
1440
1508
  _query_builder = APIHelper.append_url_with_template_parameters(
1441
1509
  _query_builder,
1442
- 'location_id' => location_id
1510
+ 'location_id' => { 'value' => location_id, 'encode' => true }
1443
1511
  )
1444
1512
  _query_url = APIHelper.clean_url _query_builder
1445
1513
 
@@ -1459,7 +1527,9 @@ module Square
1459
1527
  # Return appropriate response type.
1460
1528
  decoded = APIHelper.json_deserialize(_response.raw_body)
1461
1529
  _errors = APIHelper.map_response(decoded, ['errors'])
1462
- ApiResponse.new(_response, data: decoded, errors: _errors)
1530
+ ApiResponse.new(
1531
+ _response, data: decoded, errors: _errors
1532
+ )
1463
1533
  end
1464
1534
 
1465
1535
  # Creates a Favorites page in Square Point of Sale.
@@ -1477,7 +1547,7 @@ module Square
1477
1547
  _query_builder << '/v1/{location_id}/pages'
1478
1548
  _query_builder = APIHelper.append_url_with_template_parameters(
1479
1549
  _query_builder,
1480
- 'location_id' => location_id
1550
+ 'location_id' => { 'value' => location_id, 'encode' => true }
1481
1551
  )
1482
1552
  _query_url = APIHelper.clean_url _query_builder
1483
1553
 
@@ -1499,7 +1569,9 @@ module Square
1499
1569
  # Return appropriate response type.
1500
1570
  decoded = APIHelper.json_deserialize(_response.raw_body)
1501
1571
  _errors = APIHelper.map_response(decoded, ['errors'])
1502
- ApiResponse.new(_response, data: decoded, errors: _errors)
1572
+ ApiResponse.new(
1573
+ _response, data: decoded, errors: _errors
1574
+ )
1503
1575
  end
1504
1576
 
1505
1577
  # Deletes an existing Favorites page and all of its cells.
@@ -1518,8 +1590,8 @@ module Square
1518
1590
  _query_builder << '/v1/{location_id}/pages/{page_id}'
1519
1591
  _query_builder = APIHelper.append_url_with_template_parameters(
1520
1592
  _query_builder,
1521
- 'location_id' => location_id,
1522
- 'page_id' => page_id
1593
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1594
+ 'page_id' => { 'value' => page_id, 'encode' => true }
1523
1595
  )
1524
1596
  _query_url = APIHelper.clean_url _query_builder
1525
1597
 
@@ -1539,7 +1611,9 @@ module Square
1539
1611
  # Return appropriate response type.
1540
1612
  decoded = APIHelper.json_deserialize(_response.raw_body)
1541
1613
  _errors = APIHelper.map_response(decoded, ['errors'])
1542
- ApiResponse.new(_response, data: decoded, errors: _errors)
1614
+ ApiResponse.new(
1615
+ _response, data: decoded, errors: _errors
1616
+ )
1543
1617
  end
1544
1618
 
1545
1619
  # Modifies the details of a Favorites page in Square Point of Sale.
@@ -1560,8 +1634,8 @@ module Square
1560
1634
  _query_builder << '/v1/{location_id}/pages/{page_id}'
1561
1635
  _query_builder = APIHelper.append_url_with_template_parameters(
1562
1636
  _query_builder,
1563
- 'location_id' => location_id,
1564
- 'page_id' => page_id
1637
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1638
+ 'page_id' => { 'value' => page_id, 'encode' => true }
1565
1639
  )
1566
1640
  _query_url = APIHelper.clean_url _query_builder
1567
1641
 
@@ -1583,7 +1657,9 @@ module Square
1583
1657
  # Return appropriate response type.
1584
1658
  decoded = APIHelper.json_deserialize(_response.raw_body)
1585
1659
  _errors = APIHelper.map_response(decoded, ['errors'])
1586
- ApiResponse.new(_response, data: decoded, errors: _errors)
1660
+ ApiResponse.new(
1661
+ _response, data: decoded, errors: _errors
1662
+ )
1587
1663
  end
1588
1664
 
1589
1665
  # Deletes a cell from a Favorites page in Square Point of Sale.
@@ -1610,8 +1686,8 @@ module Square
1610
1686
  _query_builder << '/v1/{location_id}/pages/{page_id}/cells'
1611
1687
  _query_builder = APIHelper.append_url_with_template_parameters(
1612
1688
  _query_builder,
1613
- 'location_id' => location_id,
1614
- 'page_id' => page_id
1689
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1690
+ 'page_id' => { 'value' => page_id, 'encode' => true }
1615
1691
  )
1616
1692
  _query_builder = APIHelper.append_url_with_query_parameters(
1617
1693
  _query_builder,
@@ -1636,7 +1712,9 @@ module Square
1636
1712
  # Return appropriate response type.
1637
1713
  decoded = APIHelper.json_deserialize(_response.raw_body)
1638
1714
  _errors = APIHelper.map_response(decoded, ['errors'])
1639
- ApiResponse.new(_response, data: decoded, errors: _errors)
1715
+ ApiResponse.new(
1716
+ _response, data: decoded, errors: _errors
1717
+ )
1640
1718
  end
1641
1719
 
1642
1720
  # Modifies a cell of a Favorites page in Square Point of Sale.
@@ -1657,8 +1735,8 @@ module Square
1657
1735
  _query_builder << '/v1/{location_id}/pages/{page_id}/cells'
1658
1736
  _query_builder = APIHelper.append_url_with_template_parameters(
1659
1737
  _query_builder,
1660
- 'location_id' => location_id,
1661
- 'page_id' => page_id
1738
+ 'location_id' => { 'value' => location_id, 'encode' => true },
1739
+ 'page_id' => { 'value' => page_id, 'encode' => true }
1662
1740
  )
1663
1741
  _query_url = APIHelper.clean_url _query_builder
1664
1742
 
@@ -1680,7 +1758,9 @@ module Square
1680
1758
  # Return appropriate response type.
1681
1759
  decoded = APIHelper.json_deserialize(_response.raw_body)
1682
1760
  _errors = APIHelper.map_response(decoded, ['errors'])
1683
- ApiResponse.new(_response, data: decoded, errors: _errors)
1761
+ ApiResponse.new(
1762
+ _response, data: decoded, errors: _errors
1763
+ )
1684
1764
  end
1685
1765
  end
1686
1766
  end