square.rb 33.0.0.20231018 → 42.1.0.20250416

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/lib/square/api/apple_pay_api.rb +15 -11
  4. data/lib/square/api/bank_accounts_api.rb +12 -12
  5. data/lib/square/api/base_api.rb +2 -1
  6. data/lib/square/api/booking_custom_attributes_api.rb +44 -44
  7. data/lib/square/api/bookings_api.rb +53 -53
  8. data/lib/square/api/cards_api.rb +16 -16
  9. data/lib/square/api/cash_drawers_api.rb +12 -12
  10. data/lib/square/api/catalog_api.rb +67 -57
  11. data/lib/square/api/checkout_api.rb +111 -26
  12. data/lib/square/api/customer_custom_attributes_api.rb +40 -40
  13. data/lib/square/api/customer_groups_api.rb +20 -20
  14. data/lib/square/api/customer_segments_api.rb +8 -8
  15. data/lib/square/api/customers_api.rb +144 -54
  16. data/lib/square/api/devices_api.rb +20 -20
  17. data/lib/square/api/disputes_api.rb +36 -36
  18. data/lib/square/api/employees_api.rb +8 -8
  19. data/lib/square/api/events_api.rb +84 -0
  20. data/lib/square/api/gift_card_activities_api.rb +10 -11
  21. data/lib/square/api/gift_cards_api.rb +36 -33
  22. data/lib/square/api/inventory_api.rb +52 -52
  23. data/lib/square/api/invoices_api.rb +109 -41
  24. data/lib/square/api/labor_api.rb +81 -80
  25. data/lib/square/api/location_custom_attributes_api.rb +44 -44
  26. data/lib/square/api/locations_api.rb +18 -17
  27. data/lib/square/api/loyalty_api.rb +72 -72
  28. data/lib/square/api/merchant_custom_attributes_api.rb +44 -44
  29. data/lib/square/api/merchants_api.rb +8 -8
  30. data/lib/square/api/mobile_authorization_api.rb +4 -4
  31. data/lib/square/api/o_auth_api.rb +15 -69
  32. data/lib/square/api/order_custom_attributes_api.rb +44 -44
  33. data/lib/square/api/orders_api.rb +32 -32
  34. data/lib/square/api/payments_api.rb +67 -31
  35. data/lib/square/api/payouts_api.rb +12 -12
  36. data/lib/square/api/refunds_api.rb +31 -13
  37. data/lib/square/api/sites_api.rb +4 -4
  38. data/lib/square/api/snippets_api.rb +12 -12
  39. data/lib/square/api/subscriptions_api.rb +48 -48
  40. data/lib/square/api/team_api.rb +146 -40
  41. data/lib/square/api/terminal_api.rb +95 -53
  42. data/lib/square/api/transactions_api.rb +16 -16
  43. data/lib/square/api/v1_transactions_api.rb +13 -292
  44. data/lib/square/api/vendors_api.rb +28 -28
  45. data/lib/square/api/webhook_subscriptions_api.rb +32 -32
  46. data/lib/square/client.rb +32 -24
  47. data/lib/square/configuration.rb +43 -15
  48. data/lib/square/http/api_response.rb +1 -1
  49. data/lib/square/http/auth/o_auth2.rb +21 -2
  50. data/lib/square.rb +4 -3
  51. data/test/api/api_test_base.rb +1 -1
  52. data/test/api/test_locations_api.rb +1 -1
  53. data/test/api/test_refunds_api.rb +4 -1
  54. data/test/webhooks/test_webhooks_helper.rb +17 -0
  55. metadata +12 -17
@@ -6,7 +6,7 @@ module Square
6
6
  # @param [CreateLoyaltyAccountRequest] body Required parameter: An object
7
7
  # containing the fields to POST for the request. See the corresponding
8
8
  # object definition for field details.
9
- # @return [CreateLoyaltyAccountResponse Hash] response from the API call
9
+ # @return [ApiResponse] the complete http response with raw body and status code.
10
10
  def create_loyalty_account(body:)
11
11
  new_api_call_builder
12
12
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -18,9 +18,9 @@ module Square
18
18
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
19
19
  .auth(Single.new('global')))
20
20
  .response(new_response_handler
21
- .deserializer(APIHelper.method(:json_deserialize))
22
- .is_api_response(true)
23
- .convertor(ApiResponse.method(:create)))
21
+ .deserializer(APIHelper.method(:json_deserialize))
22
+ .is_api_response(true)
23
+ .convertor(ApiResponse.method(:create)))
24
24
  .execute
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ module Square
32
32
  # @param [SearchLoyaltyAccountsRequest] body Required parameter: An object
33
33
  # containing the fields to POST for the request. See the corresponding
34
34
  # object definition for field details.
35
- # @return [SearchLoyaltyAccountsResponse Hash] response from the API call
35
+ # @return [ApiResponse] the complete http response with raw body and status code.
36
36
  def search_loyalty_accounts(body:)
37
37
  new_api_call_builder
38
38
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -44,16 +44,16 @@ module Square
44
44
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
45
45
  .auth(Single.new('global')))
46
46
  .response(new_response_handler
47
- .deserializer(APIHelper.method(:json_deserialize))
48
- .is_api_response(true)
49
- .convertor(ApiResponse.method(:create)))
47
+ .deserializer(APIHelper.method(:json_deserialize))
48
+ .is_api_response(true)
49
+ .convertor(ApiResponse.method(:create)))
50
50
  .execute
51
51
  end
52
52
 
53
53
  # Retrieves a loyalty account.
54
54
  # @param [String] account_id Required parameter: The ID of the [loyalty
55
55
  # account](entity:LoyaltyAccount) to retrieve.
56
- # @return [RetrieveLoyaltyAccountResponse Hash] response from the API call
56
+ # @return [ApiResponse] the complete http response with raw body and status code.
57
57
  def retrieve_loyalty_account(account_id:)
58
58
  new_api_call_builder
59
59
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -64,9 +64,9 @@ module Square
64
64
  .header_param(new_parameter('application/json', key: 'accept'))
65
65
  .auth(Single.new('global')))
66
66
  .response(new_response_handler
67
- .deserializer(APIHelper.method(:json_deserialize))
68
- .is_api_response(true)
69
- .convertor(ApiResponse.method(:create)))
67
+ .deserializer(APIHelper.method(:json_deserialize))
68
+ .is_api_response(true)
69
+ .convertor(ApiResponse.method(:create)))
70
70
  .execute
71
71
  end
72
72
 
@@ -100,7 +100,7 @@ module Square
100
100
  # @param [AccumulateLoyaltyPointsRequest] body Required parameter: An object
101
101
  # containing the fields to POST for the request. See the corresponding
102
102
  # object definition for field details.
103
- # @return [AccumulateLoyaltyPointsResponse Hash] response from the API call
103
+ # @return [ApiResponse] the complete http response with raw body and status code.
104
104
  def accumulate_loyalty_points(account_id:,
105
105
  body:)
106
106
  new_api_call_builder
@@ -115,9 +115,9 @@ module Square
115
115
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
116
116
  .auth(Single.new('global')))
117
117
  .response(new_response_handler
118
- .deserializer(APIHelper.method(:json_deserialize))
119
- .is_api_response(true)
120
- .convertor(ApiResponse.method(:create)))
118
+ .deserializer(APIHelper.method(:json_deserialize))
119
+ .is_api_response(true)
120
+ .convertor(ApiResponse.method(:create)))
121
121
  .execute
122
122
  end
123
123
 
@@ -131,7 +131,7 @@ module Square
131
131
  # @param [AdjustLoyaltyPointsRequest] body Required parameter: An object
132
132
  # containing the fields to POST for the request. See the corresponding
133
133
  # object definition for field details.
134
- # @return [AdjustLoyaltyPointsResponse Hash] response from the API call
134
+ # @return [ApiResponse] the complete http response with raw body and status code.
135
135
  def adjust_loyalty_points(account_id:,
136
136
  body:)
137
137
  new_api_call_builder
@@ -146,9 +146,9 @@ module Square
146
146
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
147
147
  .auth(Single.new('global')))
148
148
  .response(new_response_handler
149
- .deserializer(APIHelper.method(:json_deserialize))
150
- .is_api_response(true)
151
- .convertor(ApiResponse.method(:create)))
149
+ .deserializer(APIHelper.method(:json_deserialize))
150
+ .is_api_response(true)
151
+ .convertor(ApiResponse.method(:create)))
152
152
  .execute
153
153
  end
154
154
 
@@ -163,7 +163,7 @@ module Square
163
163
  # @param [SearchLoyaltyEventsRequest] body Required parameter: An object
164
164
  # containing the fields to POST for the request. See the corresponding
165
165
  # object definition for field details.
166
- # @return [SearchLoyaltyEventsResponse Hash] response from the API call
166
+ # @return [ApiResponse] the complete http response with raw body and status code.
167
167
  def search_loyalty_events(body:)
168
168
  new_api_call_builder
169
169
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -175,9 +175,9 @@ module Square
175
175
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
176
176
  .auth(Single.new('global')))
177
177
  .response(new_response_handler
178
- .deserializer(APIHelper.method(:json_deserialize))
179
- .is_api_response(true)
180
- .convertor(ApiResponse.method(:create)))
178
+ .deserializer(APIHelper.method(:json_deserialize))
179
+ .is_api_response(true)
180
+ .convertor(ApiResponse.method(:create)))
181
181
  .execute
182
182
  end
183
183
 
@@ -190,7 +190,7 @@ module Square
190
190
  # Replaced with
191
191
  # [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when
192
192
  # used with the keyword `main`.
193
- # @return [ListLoyaltyProgramsResponse Hash] response from the API call
193
+ # @return [ApiResponse] the complete http response with raw body and status code.
194
194
  def list_loyalty_programs
195
195
  warn 'Endpoint list_loyalty_programs in LoyaltyApi is deprecated'
196
196
  new_api_call_builder
@@ -200,9 +200,9 @@ module Square
200
200
  .header_param(new_parameter('application/json', key: 'accept'))
201
201
  .auth(Single.new('global')))
202
202
  .response(new_response_handler
203
- .deserializer(APIHelper.method(:json_deserialize))
204
- .is_api_response(true)
205
- .convertor(ApiResponse.method(:create)))
203
+ .deserializer(APIHelper.method(:json_deserialize))
204
+ .is_api_response(true)
205
+ .convertor(ApiResponse.method(:create)))
206
206
  .execute
207
207
  end
208
208
 
@@ -216,7 +216,7 @@ module Square
216
216
  # @param [String] program_id Required parameter: The ID of the loyalty
217
217
  # program or the keyword `main`. Either value can be used to retrieve the
218
218
  # single loyalty program that belongs to the seller.
219
- # @return [RetrieveLoyaltyProgramResponse Hash] response from the API call
219
+ # @return [ApiResponse] the complete http response with raw body and status code.
220
220
  def retrieve_loyalty_program(program_id:)
221
221
  new_api_call_builder
222
222
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -227,9 +227,9 @@ module Square
227
227
  .header_param(new_parameter('application/json', key: 'accept'))
228
228
  .auth(Single.new('global')))
229
229
  .response(new_response_handler
230
- .deserializer(APIHelper.method(:json_deserialize))
231
- .is_api_response(true)
232
- .convertor(ApiResponse.method(:create)))
230
+ .deserializer(APIHelper.method(:json_deserialize))
231
+ .is_api_response(true)
232
+ .convertor(ApiResponse.method(:create)))
233
233
  .execute
234
234
  end
235
235
 
@@ -263,7 +263,7 @@ module Square
263
263
  # @param [CalculateLoyaltyPointsRequest] body Required parameter: An object
264
264
  # containing the fields to POST for the request. See the corresponding
265
265
  # object definition for field details.
266
- # @return [CalculateLoyaltyPointsResponse Hash] response from the API call
266
+ # @return [ApiResponse] the complete http response with raw body and status code.
267
267
  def calculate_loyalty_points(program_id:,
268
268
  body:)
269
269
  new_api_call_builder
@@ -278,9 +278,9 @@ module Square
278
278
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
279
279
  .auth(Single.new('global')))
280
280
  .response(new_response_handler
281
- .deserializer(APIHelper.method(:json_deserialize))
282
- .is_api_response(true)
283
- .convertor(ApiResponse.method(:create)))
281
+ .deserializer(APIHelper.method(:json_deserialize))
282
+ .is_api_response(true)
283
+ .convertor(ApiResponse.method(:create)))
284
284
  .execute
285
285
  end
286
286
 
@@ -307,7 +307,7 @@ module Square
307
307
  # maximum value is 30. The default value is 30. For more information, see
308
308
  # [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
309
309
  # atterns/pagination).
310
- # @return [ListLoyaltyPromotionsResponse Hash] response from the API call
310
+ # @return [ApiResponse] the complete http response with raw body and status code.
311
311
  def list_loyalty_promotions(program_id:,
312
312
  status: nil,
313
313
  cursor: nil,
@@ -324,9 +324,9 @@ module Square
324
324
  .header_param(new_parameter('application/json', key: 'accept'))
325
325
  .auth(Single.new('global')))
326
326
  .response(new_response_handler
327
- .deserializer(APIHelper.method(:json_deserialize))
328
- .is_api_response(true)
329
- .convertor(ApiResponse.method(:create)))
327
+ .deserializer(APIHelper.method(:json_deserialize))
328
+ .is_api_response(true)
329
+ .convertor(ApiResponse.method(:create)))
330
330
  .execute
331
331
  end
332
332
 
@@ -347,7 +347,7 @@ module Square
347
347
  # @param [CreateLoyaltyPromotionRequest] body Required parameter: An object
348
348
  # containing the fields to POST for the request. See the corresponding
349
349
  # object definition for field details.
350
- # @return [CreateLoyaltyPromotionResponse Hash] response from the API call
350
+ # @return [ApiResponse] the complete http response with raw body and status code.
351
351
  def create_loyalty_promotion(program_id:,
352
352
  body:)
353
353
  new_api_call_builder
@@ -362,9 +362,9 @@ module Square
362
362
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
363
363
  .auth(Single.new('global')))
364
364
  .response(new_response_handler
365
- .deserializer(APIHelper.method(:json_deserialize))
366
- .is_api_response(true)
367
- .convertor(ApiResponse.method(:create)))
365
+ .deserializer(APIHelper.method(:json_deserialize))
366
+ .is_api_response(true)
367
+ .convertor(ApiResponse.method(:create)))
368
368
  .execute
369
369
  end
370
370
 
@@ -375,7 +375,7 @@ module Square
375
375
  # program](entity:LoyaltyProgram). To get the program ID, call
376
376
  # [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram)
377
377
  # using the `main` keyword.
378
- # @return [RetrieveLoyaltyPromotionResponse Hash] response from the API call
378
+ # @return [ApiResponse] the complete http response with raw body and status code.
379
379
  def retrieve_loyalty_promotion(promotion_id:,
380
380
  program_id:)
381
381
  new_api_call_builder
@@ -389,9 +389,9 @@ module Square
389
389
  .header_param(new_parameter('application/json', key: 'accept'))
390
390
  .auth(Single.new('global')))
391
391
  .response(new_response_handler
392
- .deserializer(APIHelper.method(:json_deserialize))
393
- .is_api_response(true)
394
- .convertor(ApiResponse.method(:create)))
392
+ .deserializer(APIHelper.method(:json_deserialize))
393
+ .is_api_response(true)
394
+ .convertor(ApiResponse.method(:create)))
395
395
  .execute
396
396
  end
397
397
 
@@ -408,7 +408,7 @@ module Square
408
408
  # that has an `ACTIVE` or `SCHEDULED` status.
409
409
  # @param [String] program_id Required parameter: The ID of the base [loyalty
410
410
  # program](entity:LoyaltyProgram).
411
- # @return [CancelLoyaltyPromotionResponse Hash] response from the API call
411
+ # @return [ApiResponse] the complete http response with raw body and status code.
412
412
  def cancel_loyalty_promotion(promotion_id:,
413
413
  program_id:)
414
414
  new_api_call_builder
@@ -422,9 +422,9 @@ module Square
422
422
  .header_param(new_parameter('application/json', key: 'accept'))
423
423
  .auth(Single.new('global')))
424
424
  .response(new_response_handler
425
- .deserializer(APIHelper.method(:json_deserialize))
426
- .is_api_response(true)
427
- .convertor(ApiResponse.method(:create)))
425
+ .deserializer(APIHelper.method(:json_deserialize))
426
+ .is_api_response(true)
427
+ .convertor(ApiResponse.method(:create)))
428
428
  .execute
429
429
  end
430
430
 
@@ -439,7 +439,7 @@ module Square
439
439
  # @param [CreateLoyaltyRewardRequest] body Required parameter: An object
440
440
  # containing the fields to POST for the request. See the corresponding
441
441
  # object definition for field details.
442
- # @return [CreateLoyaltyRewardResponse Hash] response from the API call
442
+ # @return [ApiResponse] the complete http response with raw body and status code.
443
443
  def create_loyalty_reward(body:)
444
444
  new_api_call_builder
445
445
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -451,9 +451,9 @@ module Square
451
451
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
452
452
  .auth(Single.new('global')))
453
453
  .response(new_response_handler
454
- .deserializer(APIHelper.method(:json_deserialize))
455
- .is_api_response(true)
456
- .convertor(ApiResponse.method(:create)))
454
+ .deserializer(APIHelper.method(:json_deserialize))
455
+ .is_api_response(true)
456
+ .convertor(ApiResponse.method(:create)))
457
457
  .execute
458
458
  end
459
459
 
@@ -467,7 +467,7 @@ module Square
467
467
  # @param [SearchLoyaltyRewardsRequest] body Required parameter: An object
468
468
  # containing the fields to POST for the request. See the corresponding
469
469
  # object definition for field details.
470
- # @return [SearchLoyaltyRewardsResponse Hash] response from the API call
470
+ # @return [ApiResponse] the complete http response with raw body and status code.
471
471
  def search_loyalty_rewards(body:)
472
472
  new_api_call_builder
473
473
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -479,9 +479,9 @@ module Square
479
479
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
480
480
  .auth(Single.new('global')))
481
481
  .response(new_response_handler
482
- .deserializer(APIHelper.method(:json_deserialize))
483
- .is_api_response(true)
484
- .convertor(ApiResponse.method(:create)))
482
+ .deserializer(APIHelper.method(:json_deserialize))
483
+ .is_api_response(true)
484
+ .convertor(ApiResponse.method(:create)))
485
485
  .execute
486
486
  end
487
487
 
@@ -494,7 +494,7 @@ module Square
494
494
  # You cannot delete a reward that has reached the terminal state (REDEEMED).
495
495
  # @param [String] reward_id Required parameter: The ID of the [loyalty
496
496
  # reward](entity:LoyaltyReward) to delete.
497
- # @return [DeleteLoyaltyRewardResponse Hash] response from the API call
497
+ # @return [ApiResponse] the complete http response with raw body and status code.
498
498
  def delete_loyalty_reward(reward_id:)
499
499
  new_api_call_builder
500
500
  .request(new_request_builder(HttpMethodEnum::DELETE,
@@ -505,16 +505,16 @@ module Square
505
505
  .header_param(new_parameter('application/json', key: 'accept'))
506
506
  .auth(Single.new('global')))
507
507
  .response(new_response_handler
508
- .deserializer(APIHelper.method(:json_deserialize))
509
- .is_api_response(true)
510
- .convertor(ApiResponse.method(:create)))
508
+ .deserializer(APIHelper.method(:json_deserialize))
509
+ .is_api_response(true)
510
+ .convertor(ApiResponse.method(:create)))
511
511
  .execute
512
512
  end
513
513
 
514
514
  # Retrieves a loyalty reward.
515
515
  # @param [String] reward_id Required parameter: The ID of the [loyalty
516
516
  # reward](entity:LoyaltyReward) to retrieve.
517
- # @return [RetrieveLoyaltyRewardResponse Hash] response from the API call
517
+ # @return [ApiResponse] the complete http response with raw body and status code.
518
518
  def retrieve_loyalty_reward(reward_id:)
519
519
  new_api_call_builder
520
520
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -525,9 +525,9 @@ module Square
525
525
  .header_param(new_parameter('application/json', key: 'accept'))
526
526
  .auth(Single.new('global')))
527
527
  .response(new_response_handler
528
- .deserializer(APIHelper.method(:json_deserialize))
529
- .is_api_response(true)
530
- .convertor(ApiResponse.method(:create)))
528
+ .deserializer(APIHelper.method(:json_deserialize))
529
+ .is_api_response(true)
530
+ .convertor(ApiResponse.method(:create)))
531
531
  .execute
532
532
  end
533
533
 
@@ -544,7 +544,7 @@ module Square
544
544
  # @param [RedeemLoyaltyRewardRequest] body Required parameter: An object
545
545
  # containing the fields to POST for the request. See the corresponding
546
546
  # object definition for field details.
547
- # @return [RedeemLoyaltyRewardResponse Hash] response from the API call
547
+ # @return [ApiResponse] the complete http response with raw body and status code.
548
548
  def redeem_loyalty_reward(reward_id:,
549
549
  body:)
550
550
  new_api_call_builder
@@ -559,9 +559,9 @@ module Square
559
559
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
560
560
  .auth(Single.new('global')))
561
561
  .response(new_response_handler
562
- .deserializer(APIHelper.method(:json_deserialize))
563
- .is_api_response(true)
564
- .convertor(ApiResponse.method(:create)))
562
+ .deserializer(APIHelper.method(:json_deserialize))
563
+ .is_api_response(true)
564
+ .convertor(ApiResponse.method(:create)))
565
565
  .execute
566
566
  end
567
567
  end
@@ -24,7 +24,7 @@ module Square
24
24
  # more information, see
25
25
  # [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
26
26
  # atterns/pagination).
27
- # @return [ListMerchantCustomAttributeDefinitionsResponse Hash] response from the API call
27
+ # @return [ApiResponse] the complete http response with raw body and status code.
28
28
  def list_merchant_custom_attribute_definitions(visibility_filter: nil,
29
29
  limit: nil,
30
30
  cursor: nil)
@@ -38,9 +38,9 @@ module Square
38
38
  .header_param(new_parameter('application/json', key: 'accept'))
39
39
  .auth(Single.new('global')))
40
40
  .response(new_response_handler
41
- .deserializer(APIHelper.method(:json_deserialize))
42
- .is_api_response(true)
43
- .convertor(ApiResponse.method(:create)))
41
+ .deserializer(APIHelper.method(:json_deserialize))
42
+ .is_api_response(true)
43
+ .convertor(ApiResponse.method(:create)))
44
44
  .execute
45
45
  end
46
46
 
@@ -59,7 +59,7 @@ module Square
59
59
  # @param [CreateMerchantCustomAttributeDefinitionRequest] body Required
60
60
  # parameter: An object containing the fields to POST for the request. See
61
61
  # the corresponding object definition for field details.
62
- # @return [CreateMerchantCustomAttributeDefinitionResponse Hash] response from the API call
62
+ # @return [ApiResponse] the complete http response with raw body and status code.
63
63
  def create_merchant_custom_attribute_definition(body:)
64
64
  new_api_call_builder
65
65
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -71,9 +71,9 @@ module Square
71
71
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
72
72
  .auth(Single.new('global')))
73
73
  .response(new_response_handler
74
- .deserializer(APIHelper.method(:json_deserialize))
75
- .is_api_response(true)
76
- .convertor(ApiResponse.method(:create)))
74
+ .deserializer(APIHelper.method(:json_deserialize))
75
+ .is_api_response(true)
76
+ .convertor(ApiResponse.method(:create)))
77
77
  .execute
78
78
  end
79
79
 
@@ -85,7 +85,7 @@ module Square
85
85
  # Only the definition owner can delete a custom attribute definition.
86
86
  # @param [String] key Required parameter: The key of the custom attribute
87
87
  # definition to delete.
88
- # @return [DeleteMerchantCustomAttributeDefinitionResponse Hash] response from the API call
88
+ # @return [ApiResponse] the complete http response with raw body and status code.
89
89
  def delete_merchant_custom_attribute_definition(key:)
90
90
  new_api_call_builder
91
91
  .request(new_request_builder(HttpMethodEnum::DELETE,
@@ -96,9 +96,9 @@ module Square
96
96
  .header_param(new_parameter('application/json', key: 'accept'))
97
97
  .auth(Single.new('global')))
98
98
  .response(new_response_handler
99
- .deserializer(APIHelper.method(:json_deserialize))
100
- .is_api_response(true)
101
- .convertor(ApiResponse.method(:create)))
99
+ .deserializer(APIHelper.method(:json_deserialize))
100
+ .is_api_response(true)
101
+ .convertor(ApiResponse.method(:create)))
102
102
  .execute
103
103
  end
104
104
 
@@ -116,7 +116,7 @@ module Square
116
116
  # the request, Square returns the specified version or a higher version if
117
117
  # one exists. If the specified version is higher than the current version,
118
118
  # Square returns a `BAD_REQUEST` error.
119
- # @return [RetrieveMerchantCustomAttributeDefinitionResponse Hash] response from the API call
119
+ # @return [ApiResponse] the complete http response with raw body and status code.
120
120
  def retrieve_merchant_custom_attribute_definition(key:,
121
121
  version: nil)
122
122
  new_api_call_builder
@@ -129,9 +129,9 @@ module Square
129
129
  .header_param(new_parameter('application/json', key: 'accept'))
130
130
  .auth(Single.new('global')))
131
131
  .response(new_response_handler
132
- .deserializer(APIHelper.method(:json_deserialize))
133
- .is_api_response(true)
134
- .convertor(ApiResponse.method(:create)))
132
+ .deserializer(APIHelper.method(:json_deserialize))
133
+ .is_api_response(true)
134
+ .convertor(ApiResponse.method(:create)))
135
135
  .execute
136
136
  end
137
137
 
@@ -146,7 +146,7 @@ module Square
146
146
  # @param [UpdateMerchantCustomAttributeDefinitionRequest] body Required
147
147
  # parameter: An object containing the fields to POST for the request. See
148
148
  # the corresponding object definition for field details.
149
- # @return [UpdateMerchantCustomAttributeDefinitionResponse Hash] response from the API call
149
+ # @return [ApiResponse] the complete http response with raw body and status code.
150
150
  def update_merchant_custom_attribute_definition(key:,
151
151
  body:)
152
152
  new_api_call_builder
@@ -161,9 +161,9 @@ module Square
161
161
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
162
162
  .auth(Single.new('global')))
163
163
  .response(new_response_handler
164
- .deserializer(APIHelper.method(:json_deserialize))
165
- .is_api_response(true)
166
- .convertor(ApiResponse.method(:create)))
164
+ .deserializer(APIHelper.method(:json_deserialize))
165
+ .is_api_response(true)
166
+ .convertor(ApiResponse.method(:create)))
167
167
  .execute
168
168
  end
169
169
 
@@ -175,7 +175,7 @@ module Square
175
175
  # @param [BulkDeleteMerchantCustomAttributesRequest] body Required
176
176
  # parameter: An object containing the fields to POST for the request. See
177
177
  # the corresponding object definition for field details.
178
- # @return [BulkDeleteMerchantCustomAttributesResponse Hash] response from the API call
178
+ # @return [ApiResponse] the complete http response with raw body and status code.
179
179
  def bulk_delete_merchant_custom_attributes(body:)
180
180
  new_api_call_builder
181
181
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -187,9 +187,9 @@ module Square
187
187
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
188
188
  .auth(Single.new('global')))
189
189
  .response(new_response_handler
190
- .deserializer(APIHelper.method(:json_deserialize))
191
- .is_api_response(true)
192
- .convertor(ApiResponse.method(:create)))
190
+ .deserializer(APIHelper.method(:json_deserialize))
191
+ .is_api_response(true)
192
+ .convertor(ApiResponse.method(:create)))
193
193
  .execute
194
194
  end
195
195
 
@@ -215,7 +215,7 @@ module Square
215
215
  # @param [BulkUpsertMerchantCustomAttributesRequest] body Required
216
216
  # parameter: An object containing the fields to POST for the request. See
217
217
  # the corresponding object definition for field details.
218
- # @return [BulkUpsertMerchantCustomAttributesResponse Hash] response from the API call
218
+ # @return [ApiResponse] the complete http response with raw body and status code.
219
219
  def bulk_upsert_merchant_custom_attributes(body:)
220
220
  new_api_call_builder
221
221
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -227,9 +227,9 @@ module Square
227
227
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
228
228
  .auth(Single.new('global')))
229
229
  .response(new_response_handler
230
- .deserializer(APIHelper.method(:json_deserialize))
231
- .is_api_response(true)
232
- .convertor(ApiResponse.method(:create)))
230
+ .deserializer(APIHelper.method(:json_deserialize))
231
+ .is_api_response(true)
232
+ .convertor(ApiResponse.method(:create)))
233
233
  .execute
234
234
  end
235
235
 
@@ -265,7 +265,7 @@ module Square
265
265
  # each custom attribute. Set this parameter to `true` to get the name and
266
266
  # description of each custom attribute, information about the data type, or
267
267
  # other definition details. The default value is `false`.
268
- # @return [ListMerchantCustomAttributesResponse Hash] response from the API call
268
+ # @return [ApiResponse] the complete http response with raw body and status code.
269
269
  def list_merchant_custom_attributes(merchant_id:,
270
270
  visibility_filter: nil,
271
271
  limit: nil,
@@ -284,9 +284,9 @@ module Square
284
284
  .header_param(new_parameter('application/json', key: 'accept'))
285
285
  .auth(Single.new('global')))
286
286
  .response(new_response_handler
287
- .deserializer(APIHelper.method(:json_deserialize))
288
- .is_api_response(true)
289
- .convertor(ApiResponse.method(:create)))
287
+ .deserializer(APIHelper.method(:json_deserialize))
288
+ .is_api_response(true)
289
+ .convertor(ApiResponse.method(:create)))
290
290
  .execute
291
291
  end
292
292
 
@@ -301,7 +301,7 @@ module Square
301
301
  # delete. This key must match the `key` of a custom attribute definition in
302
302
  # the Square seller account. If the requesting application is not the
303
303
  # definition owner, you must use the qualified key.
304
- # @return [DeleteMerchantCustomAttributeResponse Hash] response from the API call
304
+ # @return [ApiResponse] the complete http response with raw body and status code.
305
305
  def delete_merchant_custom_attribute(merchant_id:,
306
306
  key:)
307
307
  new_api_call_builder
@@ -315,9 +315,9 @@ module Square
315
315
  .header_param(new_parameter('application/json', key: 'accept'))
316
316
  .auth(Single.new('global')))
317
317
  .response(new_response_handler
318
- .deserializer(APIHelper.method(:json_deserialize))
319
- .is_api_response(true)
320
- .convertor(ApiResponse.method(:create)))
318
+ .deserializer(APIHelper.method(:json_deserialize))
319
+ .is_api_response(true)
320
+ .convertor(ApiResponse.method(:create)))
321
321
  .execute
322
322
  end
323
323
 
@@ -347,7 +347,7 @@ module Square
347
347
  # Square returns the specified version or a higher version if one exists. If
348
348
  # the specified version is higher than the current version, Square returns a
349
349
  # `BAD_REQUEST` error.
350
- # @return [RetrieveMerchantCustomAttributeResponse Hash] response from the API call
350
+ # @return [ApiResponse] the complete http response with raw body and status code.
351
351
  def retrieve_merchant_custom_attribute(merchant_id:,
352
352
  key:,
353
353
  with_definition: false,
@@ -365,9 +365,9 @@ module Square
365
365
  .header_param(new_parameter('application/json', key: 'accept'))
366
366
  .auth(Single.new('global')))
367
367
  .response(new_response_handler
368
- .deserializer(APIHelper.method(:json_deserialize))
369
- .is_api_response(true)
370
- .convertor(ApiResponse.method(:create)))
368
+ .deserializer(APIHelper.method(:json_deserialize))
369
+ .is_api_response(true)
370
+ .convertor(ApiResponse.method(:create)))
371
371
  .execute
372
372
  end
373
373
 
@@ -392,7 +392,7 @@ module Square
392
392
  # @param [UpsertMerchantCustomAttributeRequest] body Required parameter: An
393
393
  # object containing the fields to POST for the request. See the
394
394
  # corresponding object definition for field details.
395
- # @return [UpsertMerchantCustomAttributeResponse Hash] response from the API call
395
+ # @return [ApiResponse] the complete http response with raw body and status code.
396
396
  def upsert_merchant_custom_attribute(merchant_id:,
397
397
  key:,
398
398
  body:)
@@ -410,9 +410,9 @@ module Square
410
410
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
411
411
  .auth(Single.new('global')))
412
412
  .response(new_response_handler
413
- .deserializer(APIHelper.method(:json_deserialize))
414
- .is_api_response(true)
415
- .convertor(ApiResponse.method(:create)))
413
+ .deserializer(APIHelper.method(:json_deserialize))
414
+ .is_api_response(true)
415
+ .convertor(ApiResponse.method(:create)))
416
416
  .execute
417
417
  end
418
418
  end