square.rb 6.4.0.20200923 → 6.5.0.20201028

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -30
  3. data/lib/square.rb +61 -61
  4. data/lib/square/api/apple_pay_api.rb +3 -1
  5. data/lib/square/api/bank_accounts_api.rb +12 -15
  6. data/lib/square/api/base_api.rb +1 -1
  7. data/lib/square/api/cash_drawers_api.rb +11 -5
  8. data/lib/square/api/catalog_api.rb +47 -25
  9. data/lib/square/api/checkout_api.rb +4 -2
  10. data/lib/square/api/customer_groups_api.rb +18 -8
  11. data/lib/square/api/customer_segments_api.rb +7 -3
  12. data/lib/square/api/customers_api.rb +47 -27
  13. data/lib/square/api/devices_api.rb +17 -6
  14. data/lib/square/api/disputes_api.rb +37 -19
  15. data/lib/square/api/employees_api.rb +7 -3
  16. data/lib/square/api/inventory_api.rb +25 -11
  17. data/lib/square/api/invoices_api.rb +29 -13
  18. data/lib/square/api/labor_api.rb +57 -25
  19. data/lib/square/api/locations_api.rb +16 -13
  20. data/lib/square/api/loyalty_api.rb +59 -65
  21. data/lib/square/api/merchants_api.rb +7 -3
  22. data/lib/square/api/mobile_authorization_api.rb +3 -1
  23. data/lib/square/api/o_auth_api.rb +10 -4
  24. data/lib/square/api/orders_api.rb +55 -8
  25. data/lib/square/api/payments_api.rb +68 -55
  26. data/lib/square/api/refunds_api.rb +12 -6
  27. data/lib/square/api/subscriptions_api.rb +22 -10
  28. data/lib/square/api/team_api.rb +32 -16
  29. data/lib/square/api/terminal_api.rb +156 -7
  30. data/lib/square/api/transactions_api.rb +32 -18
  31. data/lib/square/api/v1_employees_api.rb +59 -27
  32. data/lib/square/api/v1_items_api.rb +195 -115
  33. data/lib/square/api/v1_locations_api.rb +6 -2
  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 +2 -2
  37. data/lib/square/configuration.rb +1 -1
  38. data/lib/square/http/api_response.rb +2 -0
  39. data/lib/square/http/faraday_client.rb +1 -0
  40. data/spec/user_journey_spec.rb +2 -5
  41. data/test/api/test_locations_api.rb +1 -1
  42. metadata +3 -3
@@ -75,7 +75,9 @@ module Square
75
75
  # Return appropriate response type.
76
76
  decoded = APIHelper.json_deserialize(_response.raw_body)
77
77
  _errors = APIHelper.map_response(decoded, ['errors'])
78
- ApiResponse.new(_response, data: decoded, errors: _errors)
78
+ ApiResponse.new(
79
+ _response, data: decoded, errors: _errors
80
+ )
79
81
  end
80
82
 
81
83
  # Use the CreateEmployee endpoint to add an employee to a Square
@@ -115,7 +117,9 @@ module Square
115
117
  # Return appropriate response type.
116
118
  decoded = APIHelper.json_deserialize(_response.raw_body)
117
119
  _errors = APIHelper.map_response(decoded, ['errors'])
118
- ApiResponse.new(_response, data: decoded, errors: _errors)
120
+ ApiResponse.new(
121
+ _response, data: decoded, errors: _errors
122
+ )
119
123
  end
120
124
 
121
125
  # Provides the details for a single employee.
@@ -127,7 +131,7 @@ module Square
127
131
  _query_builder << '/v1/me/employees/{employee_id}'
128
132
  _query_builder = APIHelper.append_url_with_template_parameters(
129
133
  _query_builder,
130
- 'employee_id' => employee_id
134
+ 'employee_id' => { 'value' => employee_id, 'encode' => true }
131
135
  )
132
136
  _query_url = APIHelper.clean_url _query_builder
133
137
 
@@ -147,7 +151,9 @@ module Square
147
151
  # Return appropriate response type.
148
152
  decoded = APIHelper.json_deserialize(_response.raw_body)
149
153
  _errors = APIHelper.map_response(decoded, ['errors'])
150
- ApiResponse.new(_response, data: decoded, errors: _errors)
154
+ ApiResponse.new(
155
+ _response, data: decoded, errors: _errors
156
+ )
151
157
  end
152
158
 
153
159
  # UpdateEmployee
@@ -164,7 +170,7 @@ module Square
164
170
  _query_builder << '/v1/me/employees/{employee_id}'
165
171
  _query_builder = APIHelper.append_url_with_template_parameters(
166
172
  _query_builder,
167
- 'employee_id' => employee_id
173
+ 'employee_id' => { 'value' => employee_id, 'encode' => true }
168
174
  )
169
175
  _query_url = APIHelper.clean_url _query_builder
170
176
 
@@ -186,7 +192,9 @@ module Square
186
192
  # Return appropriate response type.
187
193
  decoded = APIHelper.json_deserialize(_response.raw_body)
188
194
  _errors = APIHelper.map_response(decoded, ['errors'])
189
- ApiResponse.new(_response, data: decoded, errors: _errors)
195
+ ApiResponse.new(
196
+ _response, data: decoded, errors: _errors
197
+ )
190
198
  end
191
199
 
192
200
  # Provides summary information for all of a business's employee roles.
@@ -230,7 +238,9 @@ module Square
230
238
  # Return appropriate response type.
231
239
  decoded = APIHelper.json_deserialize(_response.raw_body)
232
240
  _errors = APIHelper.map_response(decoded, ['errors'])
233
- ApiResponse.new(_response, data: decoded, errors: _errors)
241
+ ApiResponse.new(
242
+ _response, data: decoded, errors: _errors
243
+ )
234
244
  end
235
245
 
236
246
  # Creates an employee role you can then assign to employees.
@@ -270,7 +280,9 @@ module Square
270
280
  # Return appropriate response type.
271
281
  decoded = APIHelper.json_deserialize(_response.raw_body)
272
282
  _errors = APIHelper.map_response(decoded, ['errors'])
273
- ApiResponse.new(_response, data: decoded, errors: _errors)
283
+ ApiResponse.new(
284
+ _response, data: decoded, errors: _errors
285
+ )
274
286
  end
275
287
 
276
288
  # Provides the details for a single employee role.
@@ -282,7 +294,7 @@ module Square
282
294
  _query_builder << '/v1/me/roles/{role_id}'
283
295
  _query_builder = APIHelper.append_url_with_template_parameters(
284
296
  _query_builder,
285
- 'role_id' => role_id
297
+ 'role_id' => { 'value' => role_id, 'encode' => true }
286
298
  )
287
299
  _query_url = APIHelper.clean_url _query_builder
288
300
 
@@ -302,7 +314,9 @@ module Square
302
314
  # Return appropriate response type.
303
315
  decoded = APIHelper.json_deserialize(_response.raw_body)
304
316
  _errors = APIHelper.map_response(decoded, ['errors'])
305
- ApiResponse.new(_response, data: decoded, errors: _errors)
317
+ ApiResponse.new(
318
+ _response, data: decoded, errors: _errors
319
+ )
306
320
  end
307
321
 
308
322
  # Modifies the details of an employee role.
@@ -319,7 +333,7 @@ module Square
319
333
  _query_builder << '/v1/me/roles/{role_id}'
320
334
  _query_builder = APIHelper.append_url_with_template_parameters(
321
335
  _query_builder,
322
- 'role_id' => role_id
336
+ 'role_id' => { 'value' => role_id, 'encode' => true }
323
337
  )
324
338
  _query_url = APIHelper.clean_url _query_builder
325
339
 
@@ -341,7 +355,9 @@ module Square
341
355
  # Return appropriate response type.
342
356
  decoded = APIHelper.json_deserialize(_response.raw_body)
343
357
  _errors = APIHelper.map_response(decoded, ['errors'])
344
- ApiResponse.new(_response, data: decoded, errors: _errors)
358
+ ApiResponse.new(
359
+ _response, data: decoded, errors: _errors
360
+ )
345
361
  end
346
362
 
347
363
  # Provides summary information for all of a business's employee timecards.
@@ -425,7 +441,9 @@ module Square
425
441
  # Return appropriate response type.
426
442
  decoded = APIHelper.json_deserialize(_response.raw_body)
427
443
  _errors = APIHelper.map_response(decoded, ['errors'])
428
- ApiResponse.new(_response, data: decoded, errors: _errors)
444
+ ApiResponse.new(
445
+ _response, data: decoded, errors: _errors
446
+ )
429
447
  end
430
448
 
431
449
  # Creates a timecard for an employee and clocks them in with an
@@ -468,7 +486,9 @@ module Square
468
486
  # Return appropriate response type.
469
487
  decoded = APIHelper.json_deserialize(_response.raw_body)
470
488
  _errors = APIHelper.map_response(decoded, ['errors'])
471
- ApiResponse.new(_response, data: decoded, errors: _errors)
489
+ ApiResponse.new(
490
+ _response, data: decoded, errors: _errors
491
+ )
472
492
  end
473
493
 
474
494
  # Deletes a timecard. Timecards can also be deleted through the
@@ -494,7 +514,7 @@ module Square
494
514
  _query_builder << '/v1/me/timecards/{timecard_id}'
495
515
  _query_builder = APIHelper.append_url_with_template_parameters(
496
516
  _query_builder,
497
- 'timecard_id' => timecard_id
517
+ 'timecard_id' => { 'value' => timecard_id, 'encode' => true }
498
518
  )
499
519
  _query_url = APIHelper.clean_url _query_builder
500
520
 
@@ -506,7 +526,9 @@ module Square
506
526
  _response = execute_request(_request)
507
527
 
508
528
  # Return appropriate response type.
509
- ApiResponse.new(_response, data: _response.raw_body)
529
+ ApiResponse.new(
530
+ _response, data: _response.raw_body
531
+ )
510
532
  end
511
533
 
512
534
  # Provides the details for a single timecard.
@@ -524,7 +546,7 @@ module Square
524
546
  _query_builder << '/v1/me/timecards/{timecard_id}'
525
547
  _query_builder = APIHelper.append_url_with_template_parameters(
526
548
  _query_builder,
527
- 'timecard_id' => timecard_id
549
+ 'timecard_id' => { 'value' => timecard_id, 'encode' => true }
528
550
  )
529
551
  _query_url = APIHelper.clean_url _query_builder
530
552
 
@@ -544,7 +566,9 @@ module Square
544
566
  # Return appropriate response type.
545
567
  decoded = APIHelper.json_deserialize(_response.raw_body)
546
568
  _errors = APIHelper.map_response(decoded, ['errors'])
547
- ApiResponse.new(_response, data: decoded, errors: _errors)
569
+ ApiResponse.new(
570
+ _response, data: decoded, errors: _errors
571
+ )
548
572
  end
549
573
 
550
574
  # Modifies the details of a timecard with an `API_EDIT` event for
@@ -564,7 +588,7 @@ module Square
564
588
  _query_builder << '/v1/me/timecards/{timecard_id}'
565
589
  _query_builder = APIHelper.append_url_with_template_parameters(
566
590
  _query_builder,
567
- 'timecard_id' => timecard_id
591
+ 'timecard_id' => { 'value' => timecard_id, 'encode' => true }
568
592
  )
569
593
  _query_url = APIHelper.clean_url _query_builder
570
594
 
@@ -586,7 +610,9 @@ module Square
586
610
  # Return appropriate response type.
587
611
  decoded = APIHelper.json_deserialize(_response.raw_body)
588
612
  _errors = APIHelper.map_response(decoded, ['errors'])
589
- ApiResponse.new(_response, data: decoded, errors: _errors)
613
+ ApiResponse.new(
614
+ _response, data: decoded, errors: _errors
615
+ )
590
616
  end
591
617
 
592
618
  # Provides summary information for all events associated with a
@@ -606,7 +632,7 @@ module Square
606
632
  _query_builder << '/v1/me/timecards/{timecard_id}/events'
607
633
  _query_builder = APIHelper.append_url_with_template_parameters(
608
634
  _query_builder,
609
- 'timecard_id' => timecard_id
635
+ 'timecard_id' => { 'value' => timecard_id, 'encode' => true }
610
636
  )
611
637
  _query_url = APIHelper.clean_url _query_builder
612
638
 
@@ -626,7 +652,9 @@ module Square
626
652
  # Return appropriate response type.
627
653
  decoded = APIHelper.json_deserialize(_response.raw_body)
628
654
  _errors = APIHelper.map_response(decoded, ['errors'])
629
- ApiResponse.new(_response, data: decoded, errors: _errors)
655
+ ApiResponse.new(
656
+ _response, data: decoded, errors: _errors
657
+ )
630
658
  end
631
659
 
632
660
  # Provides the details for all of a location's cash drawer shifts during a
@@ -653,7 +681,7 @@ module Square
653
681
  _query_builder << '/v1/{location_id}/cash-drawer-shifts'
654
682
  _query_builder = APIHelper.append_url_with_template_parameters(
655
683
  _query_builder,
656
- 'location_id' => location_id
684
+ 'location_id' => { 'value' => location_id, 'encode' => true }
657
685
  )
658
686
  _query_builder = APIHelper.append_url_with_query_parameters(
659
687
  _query_builder,
@@ -679,7 +707,9 @@ module Square
679
707
  # Return appropriate response type.
680
708
  decoded = APIHelper.json_deserialize(_response.raw_body)
681
709
  _errors = APIHelper.map_response(decoded, ['errors'])
682
- ApiResponse.new(_response, data: decoded, errors: _errors)
710
+ ApiResponse.new(
711
+ _response, data: decoded, errors: _errors
712
+ )
683
713
  end
684
714
 
685
715
  # Provides the details for a single cash drawer shift, including all events
@@ -696,8 +726,8 @@ module Square
696
726
  _query_builder << '/v1/{location_id}/cash-drawer-shifts/{shift_id}'
697
727
  _query_builder = APIHelper.append_url_with_template_parameters(
698
728
  _query_builder,
699
- 'location_id' => location_id,
700
- 'shift_id' => shift_id
729
+ 'location_id' => { 'value' => location_id, 'encode' => true },
730
+ 'shift_id' => { 'value' => shift_id, 'encode' => true }
701
731
  )
702
732
  _query_url = APIHelper.clean_url _query_builder
703
733
 
@@ -717,7 +747,9 @@ module Square
717
747
  # Return appropriate response type.
718
748
  decoded = APIHelper.json_deserialize(_response.raw_body)
719
749
  _errors = APIHelper.map_response(decoded, ['errors'])
720
- ApiResponse.new(_response, data: decoded, errors: _errors)
750
+ ApiResponse.new(
751
+ _response, data: decoded, errors: _errors
752
+ )
721
753
  end
722
754
  end
723
755
  end
@@ -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