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
@@ -15,8 +15,8 @@ module Square
15
15
  # determined using the `created_at` field for each Payment. Default: The
16
16
  # current time.
17
17
  # @param [String] sort_order Optional parameter: The order in which results
18
- # are listed by `Payment.created_at`: - `ASC` - Oldest to newest. - `DESC` -
19
- # Newest to oldest (default).
18
+ # are listed by `ListPaymentsRequest.sort_field`: - `ASC` - Oldest to
19
+ # newest. - `DESC` - Newest to oldest (default).
20
20
  # @param [String] cursor Optional parameter: A pagination cursor returned by
21
21
  # a previous call to this endpoint. Provide this cursor to retrieve the next
22
22
  # set of results for the original query. For more information, see
@@ -37,7 +37,31 @@ module Square
37
37
  # also the maximum allowed value. If the provided value is greater than
38
38
  # 100, it is ignored and the default value is used instead. Default:
39
39
  # `100`
40
- # @return [ListPaymentsResponse Hash] response from the API call
40
+ # @param [TrueClass | FalseClass] is_offline_payment Optional parameter:
41
+ # Whether the payment was taken offline or not.
42
+ # @param [String] offline_begin_time Optional parameter: Indicates the start
43
+ # of the time range for which to retrieve offline payments, in RFC 3339
44
+ # format for timestamps. The range is determined using the
45
+ # `offline_payment_details.client_created_at` field for each Payment. If
46
+ # set, payments without a value set in
47
+ # `offline_payment_details.client_created_at` will not be returned.
48
+ # Default: The current time.
49
+ # @param [String] offline_end_time Optional parameter: Indicates the end of
50
+ # the time range for which to retrieve offline payments, in RFC 3339 format
51
+ # for timestamps. The range is determined using the
52
+ # `offline_payment_details.client_created_at` field for each Payment. If
53
+ # set, payments without a value set in
54
+ # `offline_payment_details.client_created_at` will not be returned.
55
+ # Default: The current time.
56
+ # @param [String] updated_at_begin_time Optional parameter: Indicates the
57
+ # start of the time range to retrieve payments for, in RFC 3339 format. The
58
+ # range is determined using the `updated_at` field for each Payment.
59
+ # @param [String] updated_at_end_time Optional parameter: Indicates the end
60
+ # of the time range to retrieve payments for, in RFC 3339 format. The range
61
+ # is determined using the `updated_at` field for each Payment.
62
+ # @param [PaymentSortField] sort_field Optional parameter: The field used to
63
+ # sort results by. The default is `CREATED_AT`.
64
+ # @return [ApiResponse] the complete http response with raw body and status code.
41
65
  def list_payments(begin_time: nil,
42
66
  end_time: nil,
43
67
  sort_order: nil,
@@ -46,7 +70,13 @@ module Square
46
70
  total: nil,
47
71
  last_4: nil,
48
72
  card_brand: nil,
49
- limit: nil)
73
+ limit: nil,
74
+ is_offline_payment: false,
75
+ offline_begin_time: nil,
76
+ offline_end_time: nil,
77
+ updated_at_begin_time: nil,
78
+ updated_at_end_time: nil,
79
+ sort_field: nil)
50
80
  new_api_call_builder
51
81
  .request(new_request_builder(HttpMethodEnum::GET,
52
82
  '/v2/payments',
@@ -60,12 +90,18 @@ module Square
60
90
  .query_param(new_parameter(last_4, key: 'last_4'))
61
91
  .query_param(new_parameter(card_brand, key: 'card_brand'))
62
92
  .query_param(new_parameter(limit, key: 'limit'))
93
+ .query_param(new_parameter(is_offline_payment, key: 'is_offline_payment'))
94
+ .query_param(new_parameter(offline_begin_time, key: 'offline_begin_time'))
95
+ .query_param(new_parameter(offline_end_time, key: 'offline_end_time'))
96
+ .query_param(new_parameter(updated_at_begin_time, key: 'updated_at_begin_time'))
97
+ .query_param(new_parameter(updated_at_end_time, key: 'updated_at_end_time'))
98
+ .query_param(new_parameter(sort_field, key: 'sort_field'))
63
99
  .header_param(new_parameter('application/json', key: 'accept'))
64
100
  .auth(Single.new('global')))
65
101
  .response(new_response_handler
66
- .deserializer(APIHelper.method(:json_deserialize))
67
- .is_api_response(true)
68
- .convertor(ApiResponse.method(:create)))
102
+ .deserializer(APIHelper.method(:json_deserialize))
103
+ .is_api_response(true)
104
+ .convertor(ApiResponse.method(:create)))
69
105
  .execute
70
106
  end
71
107
 
@@ -80,7 +116,7 @@ module Square
80
116
  # @param [CreatePaymentRequest] body Required parameter: An object
81
117
  # containing the fields to POST for the request. See the corresponding
82
118
  # object definition for field details.
83
- # @return [CreatePaymentResponse Hash] response from the API call
119
+ # @return [ApiResponse] the complete http response with raw body and status code.
84
120
  def create_payment(body:)
85
121
  new_api_call_builder
86
122
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -92,9 +128,9 @@ module Square
92
128
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
93
129
  .auth(Single.new('global')))
94
130
  .response(new_response_handler
95
- .deserializer(APIHelper.method(:json_deserialize))
96
- .is_api_response(true)
97
- .convertor(ApiResponse.method(:create)))
131
+ .deserializer(APIHelper.method(:json_deserialize))
132
+ .is_api_response(true)
133
+ .convertor(ApiResponse.method(:create)))
98
134
  .execute
99
135
  end
100
136
 
@@ -116,7 +152,7 @@ module Square
116
152
  # @param [CancelPaymentByIdempotencyKeyRequest] body Required parameter: An
117
153
  # object containing the fields to POST for the request. See the
118
154
  # corresponding object definition for field details.
119
- # @return [CancelPaymentByIdempotencyKeyResponse Hash] response from the API call
155
+ # @return [ApiResponse] the complete http response with raw body and status code.
120
156
  def cancel_payment_by_idempotency_key(body:)
121
157
  new_api_call_builder
122
158
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -128,16 +164,16 @@ module Square
128
164
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
129
165
  .auth(Single.new('global')))
130
166
  .response(new_response_handler
131
- .deserializer(APIHelper.method(:json_deserialize))
132
- .is_api_response(true)
133
- .convertor(ApiResponse.method(:create)))
167
+ .deserializer(APIHelper.method(:json_deserialize))
168
+ .is_api_response(true)
169
+ .convertor(ApiResponse.method(:create)))
134
170
  .execute
135
171
  end
136
172
 
137
173
  # Retrieves details for a specific payment.
138
174
  # @param [String] payment_id Required parameter: A unique ID for the desired
139
175
  # payment.
140
- # @return [GetPaymentResponse Hash] response from the API call
176
+ # @return [ApiResponse] the complete http response with raw body and status code.
141
177
  def get_payment(payment_id:)
142
178
  new_api_call_builder
143
179
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -148,9 +184,9 @@ module Square
148
184
  .header_param(new_parameter('application/json', key: 'accept'))
149
185
  .auth(Single.new('global')))
150
186
  .response(new_response_handler
151
- .deserializer(APIHelper.method(:json_deserialize))
152
- .is_api_response(true)
153
- .convertor(ApiResponse.method(:create)))
187
+ .deserializer(APIHelper.method(:json_deserialize))
188
+ .is_api_response(true)
189
+ .convertor(ApiResponse.method(:create)))
154
190
  .execute
155
191
  end
156
192
 
@@ -161,7 +197,7 @@ module Square
161
197
  # @param [UpdatePaymentRequest] body Required parameter: An object
162
198
  # containing the fields to POST for the request. See the corresponding
163
199
  # object definition for field details.
164
- # @return [UpdatePaymentResponse Hash] response from the API call
200
+ # @return [ApiResponse] the complete http response with raw body and status code.
165
201
  def update_payment(payment_id:,
166
202
  body:)
167
203
  new_api_call_builder
@@ -176,9 +212,9 @@ module Square
176
212
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
177
213
  .auth(Single.new('global')))
178
214
  .response(new_response_handler
179
- .deserializer(APIHelper.method(:json_deserialize))
180
- .is_api_response(true)
181
- .convertor(ApiResponse.method(:create)))
215
+ .deserializer(APIHelper.method(:json_deserialize))
216
+ .is_api_response(true)
217
+ .convertor(ApiResponse.method(:create)))
182
218
  .execute
183
219
  end
184
220
 
@@ -187,7 +223,7 @@ module Square
187
223
  # the APPROVED `status`.
188
224
  # @param [String] payment_id Required parameter: The ID of the payment to
189
225
  # cancel.
190
- # @return [CancelPaymentResponse Hash] response from the API call
226
+ # @return [ApiResponse] the complete http response with raw body and status code.
191
227
  def cancel_payment(payment_id:)
192
228
  new_api_call_builder
193
229
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -198,9 +234,9 @@ module Square
198
234
  .header_param(new_parameter('application/json', key: 'accept'))
199
235
  .auth(Single.new('global')))
200
236
  .response(new_response_handler
201
- .deserializer(APIHelper.method(:json_deserialize))
202
- .is_api_response(true)
203
- .convertor(ApiResponse.method(:create)))
237
+ .deserializer(APIHelper.method(:json_deserialize))
238
+ .is_api_response(true)
239
+ .convertor(ApiResponse.method(:create)))
204
240
  .execute
205
241
  end
206
242
 
@@ -214,7 +250,7 @@ module Square
214
250
  # @param [CompletePaymentRequest] body Required parameter: An object
215
251
  # containing the fields to POST for the request. See the corresponding
216
252
  # object definition for field details.
217
- # @return [CompletePaymentResponse Hash] response from the API call
253
+ # @return [ApiResponse] the complete http response with raw body and status code.
218
254
  def complete_payment(payment_id:,
219
255
  body:)
220
256
  new_api_call_builder
@@ -229,9 +265,9 @@ module Square
229
265
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
230
266
  .auth(Single.new('global')))
231
267
  .response(new_response_handler
232
- .deserializer(APIHelper.method(:json_deserialize))
233
- .is_api_response(true)
234
- .convertor(ApiResponse.method(:create)))
268
+ .deserializer(APIHelper.method(:json_deserialize))
269
+ .is_api_response(true)
270
+ .convertor(ApiResponse.method(:create)))
235
271
  .execute
236
272
  end
237
273
  end
@@ -28,7 +28,7 @@ module Square
28
28
  # than the specified limit on a given page. The default value of 100 is also
29
29
  # the maximum allowed value. If the provided value is greater than 100, it
30
30
  # is ignored and the default value is used instead. Default: `100`
31
- # @return [ListPayoutsResponse Hash] response from the API call
31
+ # @return [ApiResponse] the complete http response with raw body and status code.
32
32
  def list_payouts(location_id: nil,
33
33
  status: nil,
34
34
  begin_time: nil,
@@ -50,9 +50,9 @@ module Square
50
50
  .header_param(new_parameter('application/json', key: 'accept'))
51
51
  .auth(Single.new('global')))
52
52
  .response(new_response_handler
53
- .deserializer(APIHelper.method(:json_deserialize))
54
- .is_api_response(true)
55
- .convertor(ApiResponse.method(:create)))
53
+ .deserializer(APIHelper.method(:json_deserialize))
54
+ .is_api_response(true)
55
+ .convertor(ApiResponse.method(:create)))
56
56
  .execute
57
57
  end
58
58
 
@@ -60,7 +60,7 @@ module Square
60
60
  # To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
61
61
  # @param [String] payout_id Required parameter: The ID of the payout to
62
62
  # retrieve the information for.
63
- # @return [GetPayoutResponse Hash] response from the API call
63
+ # @return [ApiResponse] the complete http response with raw body and status code.
64
64
  def get_payout(payout_id:)
65
65
  new_api_call_builder
66
66
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -71,9 +71,9 @@ module Square
71
71
  .header_param(new_parameter('application/json', key: 'accept'))
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
 
@@ -94,7 +94,7 @@ module Square
94
94
  # than the specified limit on a given page. The default value of 100 is also
95
95
  # the maximum allowed value. If the provided value is greater than 100, it
96
96
  # is ignored and the default value is used instead. Default: `100`
97
- # @return [ListPayoutEntriesResponse Hash] response from the API call
97
+ # @return [ApiResponse] the complete http response with raw body and status code.
98
98
  def list_payout_entries(payout_id:,
99
99
  sort_order: nil,
100
100
  cursor: nil,
@@ -111,9 +111,9 @@ module Square
111
111
  .header_param(new_parameter('application/json', key: 'accept'))
112
112
  .auth(Single.new('global')))
113
113
  .response(new_response_handler
114
- .deserializer(APIHelper.method(:json_deserialize))
115
- .is_api_response(true)
116
- .convertor(ApiResponse.method(:create)))
114
+ .deserializer(APIHelper.method(:json_deserialize))
115
+ .is_api_response(true)
116
+ .convertor(ApiResponse.method(:create)))
117
117
  .execute
118
118
  end
119
119
  end
@@ -40,7 +40,19 @@ module Square
40
40
  # to be returned in a single page. It is possible to receive fewer results
41
41
  # than the specified limit on a given page. If the supplied value is
42
42
  # greater than 100, no more than 100 results are returned. Default: 100
43
- # @return [ListPaymentRefundsResponse Hash] response from the API call
43
+ # @param [String] updated_at_begin_time Optional parameter: Indicates the
44
+ # start of the time range to retrieve each `PaymentRefund` for, in RFC 3339
45
+ # format. The range is determined using the `updated_at` field for each
46
+ # `PaymentRefund`. Default: if omitted, the time range starts at
47
+ # `begin_time`.
48
+ # @param [String] updated_at_end_time Optional parameter: Indicates the end
49
+ # of the time range to retrieve each `PaymentRefund` for, in RFC 3339
50
+ # format. The range is determined using the `updated_at` field for each
51
+ # `PaymentRefund`. Default: The current time.
52
+ # @param [String] sort_field Optional parameter: The field used to sort
53
+ # results by. The default is `CREATED_AT`. Current values include
54
+ # `CREATED_AT` and `UPDATED_AT`.
55
+ # @return [ApiResponse] the complete http response with raw body and status code.
44
56
  def list_payment_refunds(begin_time: nil,
45
57
  end_time: nil,
46
58
  sort_order: nil,
@@ -48,7 +60,10 @@ module Square
48
60
  location_id: nil,
49
61
  status: nil,
50
62
  source_type: nil,
51
- limit: nil)
63
+ limit: nil,
64
+ updated_at_begin_time: nil,
65
+ updated_at_end_time: nil,
66
+ sort_field: nil)
52
67
  new_api_call_builder
53
68
  .request(new_request_builder(HttpMethodEnum::GET,
54
69
  '/v2/refunds',
@@ -61,12 +76,15 @@ module Square
61
76
  .query_param(new_parameter(status, key: 'status'))
62
77
  .query_param(new_parameter(source_type, key: 'source_type'))
63
78
  .query_param(new_parameter(limit, key: 'limit'))
79
+ .query_param(new_parameter(updated_at_begin_time, key: 'updated_at_begin_time'))
80
+ .query_param(new_parameter(updated_at_end_time, key: 'updated_at_end_time'))
81
+ .query_param(new_parameter(sort_field, key: 'sort_field'))
64
82
  .header_param(new_parameter('application/json', key: 'accept'))
65
83
  .auth(Single.new('global')))
66
84
  .response(new_response_handler
67
- .deserializer(APIHelper.method(:json_deserialize))
68
- .is_api_response(true)
69
- .convertor(ApiResponse.method(:create)))
85
+ .deserializer(APIHelper.method(:json_deserialize))
86
+ .is_api_response(true)
87
+ .convertor(ApiResponse.method(:create)))
70
88
  .execute
71
89
  end
72
90
 
@@ -80,7 +98,7 @@ module Square
80
98
  # @param [RefundPaymentRequest] body Required parameter: An object
81
99
  # containing the fields to POST for the request. See the corresponding
82
100
  # object definition for field details.
83
- # @return [RefundPaymentResponse Hash] response from the API call
101
+ # @return [ApiResponse] the complete http response with raw body and status code.
84
102
  def refund_payment(body:)
85
103
  new_api_call_builder
86
104
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -92,16 +110,16 @@ module Square
92
110
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
93
111
  .auth(Single.new('global')))
94
112
  .response(new_response_handler
95
- .deserializer(APIHelper.method(:json_deserialize))
96
- .is_api_response(true)
97
- .convertor(ApiResponse.method(:create)))
113
+ .deserializer(APIHelper.method(:json_deserialize))
114
+ .is_api_response(true)
115
+ .convertor(ApiResponse.method(:create)))
98
116
  .execute
99
117
  end
100
118
 
101
119
  # Retrieves a specific refund using the `refund_id`.
102
120
  # @param [String] refund_id Required parameter: The unique ID for the
103
121
  # desired `PaymentRefund`.
104
- # @return [GetPaymentRefundResponse Hash] response from the API call
122
+ # @return [ApiResponse] the complete http response with raw body and status code.
105
123
  def get_payment_refund(refund_id:)
106
124
  new_api_call_builder
107
125
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -112,9 +130,9 @@ module Square
112
130
  .header_param(new_parameter('application/json', key: 'accept'))
113
131
  .auth(Single.new('global')))
114
132
  .response(new_response_handler
115
- .deserializer(APIHelper.method(:json_deserialize))
116
- .is_api_response(true)
117
- .convertor(ApiResponse.method(:create)))
133
+ .deserializer(APIHelper.method(:json_deserialize))
134
+ .is_api_response(true)
135
+ .convertor(ApiResponse.method(:create)))
118
136
  .execute
119
137
  end
120
138
  end
@@ -8,7 +8,7 @@ module Square
8
8
  # Online
9
9
  # APIs](https://developer.squareup.com/docs/online-api#early-access-program-
10
10
  # for-square-online-apis).
11
- # @return [ListSitesResponse Hash] response from the API call
11
+ # @return [ApiResponse] the complete http response with raw body and status code.
12
12
  def list_sites
13
13
  new_api_call_builder
14
14
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -17,9 +17,9 @@ module Square
17
17
  .header_param(new_parameter('application/json', key: 'accept'))
18
18
  .auth(Single.new('global')))
19
19
  .response(new_response_handler
20
- .deserializer(APIHelper.method(:json_deserialize))
21
- .is_api_response(true)
22
- .convertor(ApiResponse.method(:create)))
20
+ .deserializer(APIHelper.method(:json_deserialize))
21
+ .is_api_response(true)
22
+ .convertor(ApiResponse.method(:create)))
23
23
  .execute
24
24
  end
25
25
  end
@@ -11,7 +11,7 @@ module Square
11
11
  # for-square-online-apis).
12
12
  # @param [String] site_id Required parameter: The ID of the site that
13
13
  # contains the snippet.
14
- # @return [DeleteSnippetResponse Hash] response from the API call
14
+ # @return [ApiResponse] the complete http response with raw body and status code.
15
15
  def delete_snippet(site_id:)
16
16
  new_api_call_builder
17
17
  .request(new_request_builder(HttpMethodEnum::DELETE,
@@ -22,9 +22,9 @@ module Square
22
22
  .header_param(new_parameter('application/json', key: 'accept'))
23
23
  .auth(Single.new('global')))
24
24
  .response(new_response_handler
25
- .deserializer(APIHelper.method(:json_deserialize))
26
- .is_api_response(true)
27
- .convertor(ApiResponse.method(:create)))
25
+ .deserializer(APIHelper.method(:json_deserialize))
26
+ .is_api_response(true)
27
+ .convertor(ApiResponse.method(:create)))
28
28
  .execute
29
29
  end
30
30
 
@@ -40,7 +40,7 @@ module Square
40
40
  # for-square-online-apis).
41
41
  # @param [String] site_id Required parameter: The ID of the site that
42
42
  # contains the snippet.
43
- # @return [RetrieveSnippetResponse Hash] response from the API call
43
+ # @return [ApiResponse] the complete http response with raw body and status code.
44
44
  def retrieve_snippet(site_id:)
45
45
  new_api_call_builder
46
46
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -51,9 +51,9 @@ module Square
51
51
  .header_param(new_parameter('application/json', key: 'accept'))
52
52
  .auth(Single.new('global')))
53
53
  .response(new_response_handler
54
- .deserializer(APIHelper.method(:json_deserialize))
55
- .is_api_response(true)
56
- .convertor(ApiResponse.method(:create)))
54
+ .deserializer(APIHelper.method(:json_deserialize))
55
+ .is_api_response(true)
56
+ .convertor(ApiResponse.method(:create)))
57
57
  .execute
58
58
  end
59
59
 
@@ -74,7 +74,7 @@ module Square
74
74
  # @param [UpsertSnippetRequest] 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 [UpsertSnippetResponse Hash] response from the API call
77
+ # @return [ApiResponse] the complete http response with raw body and status code.
78
78
  def upsert_snippet(site_id:,
79
79
  body:)
80
80
  new_api_call_builder
@@ -89,9 +89,9 @@ module Square
89
89
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
90
90
  .auth(Single.new('global')))
91
91
  .response(new_response_handler
92
- .deserializer(APIHelper.method(:json_deserialize))
93
- .is_api_response(true)
94
- .convertor(ApiResponse.method(:create)))
92
+ .deserializer(APIHelper.method(:json_deserialize))
93
+ .is_api_response(true)
94
+ .convertor(ApiResponse.method(:create)))
95
95
  .execute
96
96
  end
97
97
  end