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
@@ -11,7 +11,7 @@ module Square
11
11
  # @param [String] batch_token Optional parameter: A pagination cursor to
12
12
  # retrieve the next set of results for your original query to the
13
13
  # endpoint.
14
- # @return [Array[V1Order] Hash] response from the API call
14
+ # @return [ApiResponse] the complete http response with raw body and status code.
15
15
  def v1_list_orders(location_id:,
16
16
  order: nil,
17
17
  limit: nil,
@@ -29,10 +29,10 @@ module Square
29
29
  .header_param(new_parameter('application/json', key: 'accept'))
30
30
  .auth(Single.new('global')))
31
31
  .response(new_response_handler
32
- .deserializer(APIHelper.method(:json_deserialize))
33
- .is_api_response(true)
34
- .convertor(ApiResponse.method(:create))
35
- .is_response_array(true))
32
+ .deserializer(APIHelper.method(:json_deserialize))
33
+ .is_api_response(true)
34
+ .convertor(ApiResponse.method(:create))
35
+ .is_response_array(true))
36
36
  .execute
37
37
  end
38
38
 
@@ -43,7 +43,7 @@ module Square
43
43
  # @param [String] order_id Required parameter: The order's Square-issued ID.
44
44
  # You obtain this value from Order objects returned by the List Orders
45
45
  # endpoint
46
- # @return [V1Order Hash] response from the API call
46
+ # @return [ApiResponse] the complete http response with raw body and status code.
47
47
  def v1_retrieve_order(location_id:,
48
48
  order_id:)
49
49
  warn 'Endpoint v1_retrieve_order in V1TransactionsApi is deprecated'
@@ -58,9 +58,9 @@ module Square
58
58
  .header_param(new_parameter('application/json', key: 'accept'))
59
59
  .auth(Single.new('global')))
60
60
  .response(new_response_handler
61
- .deserializer(APIHelper.method(:json_deserialize))
62
- .is_api_response(true)
63
- .convertor(ApiResponse.method(:create)))
61
+ .deserializer(APIHelper.method(:json_deserialize))
62
+ .is_api_response(true)
63
+ .convertor(ApiResponse.method(:create)))
64
64
  .execute
65
65
  end
66
66
 
@@ -74,7 +74,7 @@ module Square
74
74
  # @param [V1UpdateOrderRequest] body Required parameter: An object
75
75
  # containing the fields to POST for the request. See the corresponding
76
76
  # object definition for field details.
77
- # @return [V1Order Hash] response from the API call
77
+ # @return [ApiResponse] the complete http response with raw body and status code.
78
78
  def v1_update_order(location_id:,
79
79
  order_id:,
80
80
  body:)
@@ -93,288 +93,9 @@ module Square
93
93
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
94
94
  .auth(Single.new('global')))
95
95
  .response(new_response_handler
96
- .deserializer(APIHelper.method(:json_deserialize))
97
- .is_api_response(true)
98
- .convertor(ApiResponse.method(:create)))
99
- .execute
100
- end
101
-
102
- # Provides summary information for all payments taken for a given
103
- # Square account during a date range. Date ranges cannot exceed 1 year in
104
- # length. See Date ranges for details of inclusive and exclusive dates.
105
- # *Note**: Details for payments processed with Square Point of Sale while
106
- # in offline mode may not be transmitted to Square for up to 72 hours.
107
- # Offline payments have a `created_at` value that reflects the time the
108
- # payment was originally processed, not the time it was subsequently
109
- # transmitted to Square. Consequently, the ListPayments endpoint might
110
- # list an offline payment chronologically between online payments that
111
- # were seen in a previous request.
112
- # @param [String] location_id Required parameter: The ID of the location to
113
- # list payments for. If you specify me, this endpoint returns payments
114
- # aggregated from all of the business's locations.
115
- # @param [SortOrder] order Optional parameter: The order in which payments
116
- # are listed in the response.
117
- # @param [String] begin_time Optional parameter: The beginning of the
118
- # requested reporting period, in ISO 8601 format. If this value is before
119
- # January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error.
120
- # Default value: The current time minus one year.
121
- # @param [String] end_time Optional parameter: The end of the requested
122
- # reporting period, in ISO 8601 format. If this value is more than one year
123
- # greater than begin_time, this endpoint returns an error. Default value:
124
- # The current time.
125
- # @param [Integer] limit Optional parameter: The maximum number of payments
126
- # to return in a single response. This value cannot exceed 200.
127
- # @param [String] batch_token Optional parameter: A pagination cursor to
128
- # retrieve the next set of results for your original query to the
129
- # endpoint.
130
- # @param [TrueClass | FalseClass] include_partial Optional parameter:
131
- # Indicates whether or not to include partial payments in the response.
132
- # Partial payments will have the tenders collected so far, but the
133
- # itemizations will be empty until the payment is completed.
134
- # @return [Array[V1Payment] Hash] response from the API call
135
- def v1_list_payments(location_id:,
136
- order: nil,
137
- begin_time: nil,
138
- end_time: nil,
139
- limit: nil,
140
- batch_token: nil,
141
- include_partial: false)
142
- warn 'Endpoint v1_list_payments in V1TransactionsApi is deprecated'
143
- new_api_call_builder
144
- .request(new_request_builder(HttpMethodEnum::GET,
145
- '/v1/{location_id}/payments',
146
- 'default')
147
- .template_param(new_parameter(location_id, key: 'location_id')
148
- .should_encode(true))
149
- .query_param(new_parameter(order, key: 'order'))
150
- .query_param(new_parameter(begin_time, key: 'begin_time'))
151
- .query_param(new_parameter(end_time, key: 'end_time'))
152
- .query_param(new_parameter(limit, key: 'limit'))
153
- .query_param(new_parameter(batch_token, key: 'batch_token'))
154
- .query_param(new_parameter(include_partial, key: 'include_partial'))
155
- .header_param(new_parameter('application/json', key: 'accept'))
156
- .auth(Single.new('global')))
157
- .response(new_response_handler
158
- .deserializer(APIHelper.method(:json_deserialize))
159
- .is_api_response(true)
160
- .convertor(ApiResponse.method(:create))
161
- .is_response_array(true))
162
- .execute
163
- end
164
-
165
- # Provides comprehensive information for a single payment.
166
- # @param [String] location_id Required parameter: The ID of the payment's
167
- # associated location.
168
- # @param [String] payment_id Required parameter: The Square-issued payment
169
- # ID. payment_id comes from Payment objects returned by the List Payments
170
- # endpoint, Settlement objects returned by the List Settlements endpoint, or
171
- # Refund objects returned by the List Refunds endpoint.
172
- # @return [V1Payment Hash] response from the API call
173
- def v1_retrieve_payment(location_id:,
174
- payment_id:)
175
- warn 'Endpoint v1_retrieve_payment in V1TransactionsApi is deprecated'
176
- new_api_call_builder
177
- .request(new_request_builder(HttpMethodEnum::GET,
178
- '/v1/{location_id}/payments/{payment_id}',
179
- 'default')
180
- .template_param(new_parameter(location_id, key: 'location_id')
181
- .should_encode(true))
182
- .template_param(new_parameter(payment_id, key: 'payment_id')
183
- .should_encode(true))
184
- .header_param(new_parameter('application/json', key: 'accept'))
185
- .auth(Single.new('global')))
186
- .response(new_response_handler
187
- .deserializer(APIHelper.method(:json_deserialize))
188
- .is_api_response(true)
189
- .convertor(ApiResponse.method(:create)))
190
- .execute
191
- end
192
-
193
- # Provides the details for all refunds initiated by a merchant or any of the
194
- # merchant's mobile staff during a date range. Date ranges cannot exceed one
195
- # year in length.
196
- # @param [String] location_id Required parameter: The ID of the location to
197
- # list refunds for.
198
- # @param [SortOrder] order Optional parameter: The order in which payments
199
- # are listed in the response.
200
- # @param [String] begin_time Optional parameter: The beginning of the
201
- # requested reporting period, in ISO 8601 format. If this value is before
202
- # January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error.
203
- # Default value: The current time minus one year.
204
- # @param [String] end_time Optional parameter: The end of the requested
205
- # reporting period, in ISO 8601 format. If this value is more than one year
206
- # greater than begin_time, this endpoint returns an error. Default value:
207
- # The current time.
208
- # @param [Integer] limit Optional parameter: The approximate number of
209
- # refunds to return in a single response. Default: 100. Max: 200. Response
210
- # may contain more results than the prescribed limit when refunds are made
211
- # simultaneously to multiple tenders in a payment or when refunds are
212
- # generated in an exchange to account for the value of returned goods.
213
- # @param [String] batch_token Optional parameter: A pagination cursor to
214
- # retrieve the next set of results for your original query to the
215
- # endpoint.
216
- # @return [Array[V1Refund] Hash] response from the API call
217
- def v1_list_refunds(location_id:,
218
- order: nil,
219
- begin_time: nil,
220
- end_time: nil,
221
- limit: nil,
222
- batch_token: nil)
223
- warn 'Endpoint v1_list_refunds in V1TransactionsApi is deprecated'
224
- new_api_call_builder
225
- .request(new_request_builder(HttpMethodEnum::GET,
226
- '/v1/{location_id}/refunds',
227
- 'default')
228
- .template_param(new_parameter(location_id, key: 'location_id')
229
- .should_encode(true))
230
- .query_param(new_parameter(order, key: 'order'))
231
- .query_param(new_parameter(begin_time, key: 'begin_time'))
232
- .query_param(new_parameter(end_time, key: 'end_time'))
233
- .query_param(new_parameter(limit, key: 'limit'))
234
- .query_param(new_parameter(batch_token, key: 'batch_token'))
235
- .header_param(new_parameter('application/json', key: 'accept'))
236
- .auth(Single.new('global')))
237
- .response(new_response_handler
238
- .deserializer(APIHelper.method(:json_deserialize))
239
- .is_api_response(true)
240
- .convertor(ApiResponse.method(:create))
241
- .is_response_array(true))
242
- .execute
243
- end
244
-
245
- # Issues a refund for a previously processed payment. You must issue
246
- # a refund within 60 days of the associated payment.
247
- # You cannot issue a partial refund for a split tender payment. You must
248
- # instead issue a full or partial refund for a particular tender, by
249
- # providing the applicable tender id to the V1CreateRefund endpoint.
250
- # Issuing a full refund for a split tender payment refunds all tenders
251
- # associated with the payment.
252
- # Issuing a refund for a card payment is not reversible. For development
253
- # purposes, you can create fake cash payments in Square Point of Sale and
254
- # refund them.
255
- # @param [String] location_id Required parameter: The ID of the original
256
- # payment's associated location.
257
- # @param [V1CreateRefundRequest] body Required parameter: An object
258
- # containing the fields to POST for the request. See the corresponding
259
- # object definition for field details.
260
- # @return [V1Refund Hash] response from the API call
261
- def v1_create_refund(location_id:,
262
- body:)
263
- warn 'Endpoint v1_create_refund in V1TransactionsApi is deprecated'
264
- new_api_call_builder
265
- .request(new_request_builder(HttpMethodEnum::POST,
266
- '/v1/{location_id}/refunds',
267
- 'default')
268
- .template_param(new_parameter(location_id, key: 'location_id')
269
- .should_encode(true))
270
- .header_param(new_parameter('application/json', key: 'Content-Type'))
271
- .body_param(new_parameter(body))
272
- .header_param(new_parameter('application/json', key: 'accept'))
273
- .body_serializer(proc do |param| param.to_json unless param.nil? end)
274
- .auth(Single.new('global')))
275
- .response(new_response_handler
276
- .deserializer(APIHelper.method(:json_deserialize))
277
- .is_api_response(true)
278
- .convertor(ApiResponse.method(:create)))
279
- .execute
280
- end
281
-
282
- # Provides summary information for all deposits and withdrawals
283
- # initiated by Square to a linked bank account during a date range. Date
284
- # ranges cannot exceed one year in length.
285
- # *Note**: the ListSettlements endpoint does not provide entry
286
- # information.
287
- # @param [String] location_id Required parameter: The ID of the location to
288
- # list settlements for. If you specify me, this endpoint returns settlements
289
- # aggregated from all of the business's locations.
290
- # @param [SortOrder] order Optional parameter: The order in which
291
- # settlements are listed in the response.
292
- # @param [String] begin_time Optional parameter: The beginning of the
293
- # requested reporting period, in ISO 8601 format. If this value is before
294
- # January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error.
295
- # Default value: The current time minus one year.
296
- # @param [String] end_time Optional parameter: The end of the requested
297
- # reporting period, in ISO 8601 format. If this value is more than one year
298
- # greater than begin_time, this endpoint returns an error. Default value:
299
- # The current time.
300
- # @param [Integer] limit Optional parameter: The maximum number of
301
- # settlements to return in a single response. This value cannot exceed
302
- # 200.
303
- # @param [V1ListSettlementsRequestStatus] status Optional parameter: Provide
304
- # this parameter to retrieve only settlements with a particular status (SENT
305
- # or FAILED).
306
- # @param [String] batch_token Optional parameter: A pagination cursor to
307
- # retrieve the next set of results for your original query to the
308
- # endpoint.
309
- # @return [Array[V1Settlement] Hash] response from the API call
310
- def v1_list_settlements(location_id:,
311
- order: nil,
312
- begin_time: nil,
313
- end_time: nil,
314
- limit: nil,
315
- status: nil,
316
- batch_token: nil)
317
- warn 'Endpoint v1_list_settlements in V1TransactionsApi is deprecated'
318
- new_api_call_builder
319
- .request(new_request_builder(HttpMethodEnum::GET,
320
- '/v1/{location_id}/settlements',
321
- 'default')
322
- .template_param(new_parameter(location_id, key: 'location_id')
323
- .should_encode(true))
324
- .query_param(new_parameter(order, key: 'order'))
325
- .query_param(new_parameter(begin_time, key: 'begin_time'))
326
- .query_param(new_parameter(end_time, key: 'end_time'))
327
- .query_param(new_parameter(limit, key: 'limit'))
328
- .query_param(new_parameter(status, key: 'status'))
329
- .query_param(new_parameter(batch_token, key: 'batch_token'))
330
- .header_param(new_parameter('application/json', key: 'accept'))
331
- .auth(Single.new('global')))
332
- .response(new_response_handler
333
- .deserializer(APIHelper.method(:json_deserialize))
334
- .is_api_response(true)
335
- .convertor(ApiResponse.method(:create))
336
- .is_response_array(true))
337
- .execute
338
- end
339
-
340
- # Provides comprehensive information for a single settlement.
341
- # The returned `Settlement` objects include an `entries` field that lists
342
- # the transactions that contribute to the settlement total. Most
343
- # settlement entries correspond to a payment payout, but settlement
344
- # entries are also generated for less common events, like refunds, manual
345
- # adjustments, or chargeback holds.
346
- # Square initiates its regular deposits as indicated in the
347
- # [Deposit Options with
348
- # Square](https://squareup.com/help/us/en/article/3807)
349
- # help article. Details for a regular deposit are usually not available
350
- # from Connect API endpoints before 10 p.m. PST the same day.
351
- # Square does not know when an initiated settlement **completes**, only
352
- # whether it has failed. A completed settlement is typically reflected in
353
- # a bank account within 3 business days, but in exceptional cases it may
354
- # take longer.
355
- # @param [String] location_id Required parameter: The ID of the
356
- # settlements's associated location.
357
- # @param [String] settlement_id Required parameter: The settlement's
358
- # Square-issued ID. You obtain this value from Settlement objects returned
359
- # by the List Settlements endpoint.
360
- # @return [V1Settlement Hash] response from the API call
361
- def v1_retrieve_settlement(location_id:,
362
- settlement_id:)
363
- warn 'Endpoint v1_retrieve_settlement in V1TransactionsApi is deprecated'
364
- new_api_call_builder
365
- .request(new_request_builder(HttpMethodEnum::GET,
366
- '/v1/{location_id}/settlements/{settlement_id}',
367
- 'default')
368
- .template_param(new_parameter(location_id, key: 'location_id')
369
- .should_encode(true))
370
- .template_param(new_parameter(settlement_id, key: 'settlement_id')
371
- .should_encode(true))
372
- .header_param(new_parameter('application/json', key: 'accept'))
373
- .auth(Single.new('global')))
374
- .response(new_response_handler
375
- .deserializer(APIHelper.method(:json_deserialize))
376
- .is_api_response(true)
377
- .convertor(ApiResponse.method(:create)))
96
+ .deserializer(APIHelper.method(:json_deserialize))
97
+ .is_api_response(true)
98
+ .convertor(ApiResponse.method(:create)))
378
99
  .execute
379
100
  end
380
101
  end
@@ -6,7 +6,7 @@ module Square
6
6
  # @param [BulkCreateVendorsRequest] 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 [BulkCreateVendorsResponse Hash] response from the API call
9
+ # @return [ApiResponse] the complete http response with raw body and status code.
10
10
  def bulk_create_vendors(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
 
@@ -28,7 +28,7 @@ module Square
28
28
  # @param [BulkRetrieveVendorsRequest] body Required parameter: An object
29
29
  # containing the fields to POST for the request. See the corresponding
30
30
  # object definition for field details.
31
- # @return [BulkRetrieveVendorsResponse Hash] response from the API call
31
+ # @return [ApiResponse] the complete http response with raw body and status code.
32
32
  def bulk_retrieve_vendors(body:)
33
33
  new_api_call_builder
34
34
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -40,9 +40,9 @@ module Square
40
40
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
41
41
  .auth(Single.new('global')))
42
42
  .response(new_response_handler
43
- .deserializer(APIHelper.method(:json_deserialize))
44
- .is_api_response(true)
45
- .convertor(ApiResponse.method(:create)))
43
+ .deserializer(APIHelper.method(:json_deserialize))
44
+ .is_api_response(true)
45
+ .convertor(ApiResponse.method(:create)))
46
46
  .execute
47
47
  end
48
48
 
@@ -51,7 +51,7 @@ module Square
51
51
  # @param [BulkUpdateVendorsRequest] body Required parameter: An object
52
52
  # containing the fields to POST for the request. See the corresponding
53
53
  # object definition for field details.
54
- # @return [BulkUpdateVendorsResponse Hash] response from the API call
54
+ # @return [ApiResponse] the complete http response with raw body and status code.
55
55
  def bulk_update_vendors(body:)
56
56
  new_api_call_builder
57
57
  .request(new_request_builder(HttpMethodEnum::PUT,
@@ -63,9 +63,9 @@ module Square
63
63
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
64
64
  .auth(Single.new('global')))
65
65
  .response(new_response_handler
66
- .deserializer(APIHelper.method(:json_deserialize))
67
- .is_api_response(true)
68
- .convertor(ApiResponse.method(:create)))
66
+ .deserializer(APIHelper.method(:json_deserialize))
67
+ .is_api_response(true)
68
+ .convertor(ApiResponse.method(:create)))
69
69
  .execute
70
70
  end
71
71
 
@@ -74,7 +74,7 @@ module Square
74
74
  # @param [CreateVendorRequest] body Required parameter: An object containing
75
75
  # the fields to POST for the request. See the corresponding object
76
76
  # definition for field details.
77
- # @return [CreateVendorResponse Hash] response from the API call
77
+ # @return [ApiResponse] the complete http response with raw body and status code.
78
78
  def create_vendor(body:)
79
79
  new_api_call_builder
80
80
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -86,9 +86,9 @@ module Square
86
86
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
87
87
  .auth(Single.new('global')))
88
88
  .response(new_response_handler
89
- .deserializer(APIHelper.method(:json_deserialize))
90
- .is_api_response(true)
91
- .convertor(ApiResponse.method(:create)))
89
+ .deserializer(APIHelper.method(:json_deserialize))
90
+ .is_api_response(true)
91
+ .convertor(ApiResponse.method(:create)))
92
92
  .execute
93
93
  end
94
94
 
@@ -97,7 +97,7 @@ module Square
97
97
  # @param [SearchVendorsRequest] body Required parameter: An object
98
98
  # containing the fields to POST for the request. See the corresponding
99
99
  # object definition for field details.
100
- # @return [SearchVendorsResponse Hash] response from the API call
100
+ # @return [ApiResponse] the complete http response with raw body and status code.
101
101
  def search_vendors(body:)
102
102
  new_api_call_builder
103
103
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -109,16 +109,16 @@ module Square
109
109
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
110
110
  .auth(Single.new('global')))
111
111
  .response(new_response_handler
112
- .deserializer(APIHelper.method(:json_deserialize))
113
- .is_api_response(true)
114
- .convertor(ApiResponse.method(:create)))
112
+ .deserializer(APIHelper.method(:json_deserialize))
113
+ .is_api_response(true)
114
+ .convertor(ApiResponse.method(:create)))
115
115
  .execute
116
116
  end
117
117
 
118
118
  # Retrieves the vendor of a specified [Vendor]($m/Vendor) ID.
119
119
  # @param [String] vendor_id Required parameter: ID of the
120
120
  # [Vendor](entity:Vendor) to retrieve.
121
- # @return [RetrieveVendorResponse Hash] response from the API call
121
+ # @return [ApiResponse] the complete http response with raw body and status code.
122
122
  def retrieve_vendor(vendor_id:)
123
123
  new_api_call_builder
124
124
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -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
 
@@ -140,7 +140,7 @@ module Square
140
140
  # the fields to POST for the request. See the corresponding object
141
141
  # definition for field details.
142
142
  # @param [String] vendor_id Required parameter: Example:
143
- # @return [UpdateVendorResponse Hash] response from the API call
143
+ # @return [ApiResponse] the complete http response with raw body and status code.
144
144
  def update_vendor(body:,
145
145
  vendor_id:)
146
146
  new_api_call_builder
@@ -155,9 +155,9 @@ module Square
155
155
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
156
156
  .auth(Single.new('global')))
157
157
  .response(new_response_handler
158
- .deserializer(APIHelper.method(:json_deserialize))
159
- .is_api_response(true)
160
- .convertor(ApiResponse.method(:create)))
158
+ .deserializer(APIHelper.method(:json_deserialize))
159
+ .is_api_response(true)
160
+ .convertor(ApiResponse.method(:create)))
161
161
  .execute
162
162
  end
163
163
  end