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
@@ -14,7 +14,7 @@ module Square
14
14
  # @param [CreateSubscriptionRequest] body Required parameter: An object
15
15
  # containing the fields to POST for the request. See the corresponding
16
16
  # object definition for field details.
17
- # @return [CreateSubscriptionResponse Hash] response from the API call
17
+ # @return [ApiResponse] the complete http response with raw body and status code.
18
18
  def create_subscription(body:)
19
19
  new_api_call_builder
20
20
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -26,9 +26,9 @@ module Square
26
26
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
27
27
  .auth(Single.new('global')))
28
28
  .response(new_response_handler
29
- .deserializer(APIHelper.method(:json_deserialize))
30
- .is_api_response(true)
31
- .convertor(ApiResponse.method(:create)))
29
+ .deserializer(APIHelper.method(:json_deserialize))
30
+ .is_api_response(true)
31
+ .convertor(ApiResponse.method(:create)))
32
32
  .execute
33
33
  end
34
34
 
@@ -40,7 +40,7 @@ module Square
40
40
  # @param [BulkSwapPlanRequest] body Required parameter: An object containing
41
41
  # the fields to POST for the request. See the corresponding object
42
42
  # definition for field details.
43
- # @return [BulkSwapPlanResponse Hash] response from the API call
43
+ # @return [ApiResponse] the complete http response with raw body and status code.
44
44
  def bulk_swap_plan(body:)
45
45
  new_api_call_builder
46
46
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -52,9 +52,9 @@ module Square
52
52
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
53
53
  .auth(Single.new('global')))
54
54
  .response(new_response_handler
55
- .deserializer(APIHelper.method(:json_deserialize))
56
- .is_api_response(true)
57
- .convertor(ApiResponse.method(:create)))
55
+ .deserializer(APIHelper.method(:json_deserialize))
56
+ .is_api_response(true)
57
+ .convertor(ApiResponse.method(:create)))
58
58
  .execute
59
59
  end
60
60
 
@@ -74,7 +74,7 @@ module Square
74
74
  # @param [SearchSubscriptionsRequest] 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 [SearchSubscriptionsResponse Hash] response from the API call
77
+ # @return [ApiResponse] the complete http response with raw body and status code.
78
78
  def search_subscriptions(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
 
@@ -99,7 +99,7 @@ module Square
99
99
  # related information to be included in the response. The supported query
100
100
  # parameter values are: - `actions`: to include scheduled actions on the
101
101
  # targeted subscription.
102
- # @return [RetrieveSubscriptionResponse Hash] response from the API call
102
+ # @return [ApiResponse] the complete http response with raw body and status code.
103
103
  def retrieve_subscription(subscription_id:,
104
104
  include: nil)
105
105
  new_api_call_builder
@@ -112,9 +112,9 @@ module Square
112
112
  .header_param(new_parameter('application/json', key: 'accept'))
113
113
  .auth(Single.new('global')))
114
114
  .response(new_response_handler
115
- .deserializer(APIHelper.method(:json_deserialize))
116
- .is_api_response(true)
117
- .convertor(ApiResponse.method(:create)))
115
+ .deserializer(APIHelper.method(:json_deserialize))
116
+ .is_api_response(true)
117
+ .convertor(ApiResponse.method(:create)))
118
118
  .execute
119
119
  end
120
120
 
@@ -126,7 +126,7 @@ module Square
126
126
  # @param [UpdateSubscriptionRequest] body Required parameter: An object
127
127
  # containing the fields to POST for the request. See the corresponding
128
128
  # object definition for field details.
129
- # @return [UpdateSubscriptionResponse Hash] response from the API call
129
+ # @return [ApiResponse] the complete http response with raw body and status code.
130
130
  def update_subscription(subscription_id:,
131
131
  body:)
132
132
  new_api_call_builder
@@ -141,9 +141,9 @@ module Square
141
141
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
142
142
  .auth(Single.new('global')))
143
143
  .response(new_response_handler
144
- .deserializer(APIHelper.method(:json_deserialize))
145
- .is_api_response(true)
146
- .convertor(ApiResponse.method(:create)))
144
+ .deserializer(APIHelper.method(:json_deserialize))
145
+ .is_api_response(true)
146
+ .convertor(ApiResponse.method(:create)))
147
147
  .execute
148
148
  end
149
149
 
@@ -152,7 +152,7 @@ module Square
152
152
  # subscription the targeted action is to act upon.
153
153
  # @param [String] action_id Required parameter: The ID of the targeted
154
154
  # action to be deleted.
155
- # @return [DeleteSubscriptionActionResponse Hash] response from the API call
155
+ # @return [ApiResponse] the complete http response with raw body and status code.
156
156
  def delete_subscription_action(subscription_id:,
157
157
  action_id:)
158
158
  new_api_call_builder
@@ -166,9 +166,9 @@ module Square
166
166
  .header_param(new_parameter('application/json', key: 'accept'))
167
167
  .auth(Single.new('global')))
168
168
  .response(new_response_handler
169
- .deserializer(APIHelper.method(:json_deserialize))
170
- .is_api_response(true)
171
- .convertor(ApiResponse.method(:create)))
169
+ .deserializer(APIHelper.method(:json_deserialize))
170
+ .is_api_response(true)
171
+ .convertor(ApiResponse.method(:create)))
172
172
  .execute
173
173
  end
174
174
 
@@ -181,7 +181,7 @@ module Square
181
181
  # @param [ChangeBillingAnchorDateRequest] body Required parameter: An object
182
182
  # containing the fields to POST for the request. See the corresponding
183
183
  # object definition for field details.
184
- # @return [ChangeBillingAnchorDateResponse Hash] response from the API call
184
+ # @return [ApiResponse] the complete http response with raw body and status code.
185
185
  def change_billing_anchor_date(subscription_id:,
186
186
  body:)
187
187
  new_api_call_builder
@@ -196,9 +196,9 @@ module Square
196
196
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
197
197
  .auth(Single.new('global')))
198
198
  .response(new_response_handler
199
- .deserializer(APIHelper.method(:json_deserialize))
200
- .is_api_response(true)
201
- .convertor(ApiResponse.method(:create)))
199
+ .deserializer(APIHelper.method(:json_deserialize))
200
+ .is_api_response(true)
201
+ .convertor(ApiResponse.method(:create)))
202
202
  .execute
203
203
  end
204
204
 
@@ -208,7 +208,7 @@ module Square
208
208
  # the subscription status changes from ACTIVE to CANCELED.
209
209
  # @param [String] subscription_id Required parameter: The ID of the
210
210
  # subscription to cancel.
211
- # @return [CancelSubscriptionResponse Hash] response from the API call
211
+ # @return [ApiResponse] the complete http response with raw body and status code.
212
212
  def cancel_subscription(subscription_id:)
213
213
  new_api_call_builder
214
214
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -219,9 +219,9 @@ module Square
219
219
  .header_param(new_parameter('application/json', key: 'accept'))
220
220
  .auth(Single.new('global')))
221
221
  .response(new_response_handler
222
- .deserializer(APIHelper.method(:json_deserialize))
223
- .is_api_response(true)
224
- .convertor(ApiResponse.method(:create)))
222
+ .deserializer(APIHelper.method(:json_deserialize))
223
+ .is_api_response(true)
224
+ .convertor(ApiResponse.method(:create)))
225
225
  .execute
226
226
  end
227
227
 
@@ -239,7 +239,7 @@ module Square
239
239
  # atterns/pagination).
240
240
  # @param [Integer] limit Optional parameter: The upper limit on the number
241
241
  # of subscription events to return in a paged response.
242
- # @return [ListSubscriptionEventsResponse Hash] response from the API call
242
+ # @return [ApiResponse] the complete http response with raw body and status code.
243
243
  def list_subscription_events(subscription_id:,
244
244
  cursor: nil,
245
245
  limit: nil)
@@ -254,9 +254,9 @@ module Square
254
254
  .header_param(new_parameter('application/json', key: 'accept'))
255
255
  .auth(Single.new('global')))
256
256
  .response(new_response_handler
257
- .deserializer(APIHelper.method(:json_deserialize))
258
- .is_api_response(true)
259
- .convertor(ApiResponse.method(:create)))
257
+ .deserializer(APIHelper.method(:json_deserialize))
258
+ .is_api_response(true)
259
+ .convertor(ApiResponse.method(:create)))
260
260
  .execute
261
261
  end
262
262
 
@@ -266,7 +266,7 @@ module Square
266
266
  # @param [PauseSubscriptionRequest] body Required parameter: An object
267
267
  # containing the fields to POST for the request. See the corresponding
268
268
  # object definition for field details.
269
- # @return [PauseSubscriptionResponse Hash] response from the API call
269
+ # @return [ApiResponse] the complete http response with raw body and status code.
270
270
  def pause_subscription(subscription_id:,
271
271
  body:)
272
272
  new_api_call_builder
@@ -281,9 +281,9 @@ module Square
281
281
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
282
282
  .auth(Single.new('global')))
283
283
  .response(new_response_handler
284
- .deserializer(APIHelper.method(:json_deserialize))
285
- .is_api_response(true)
286
- .convertor(ApiResponse.method(:create)))
284
+ .deserializer(APIHelper.method(:json_deserialize))
285
+ .is_api_response(true)
286
+ .convertor(ApiResponse.method(:create)))
287
287
  .execute
288
288
  end
289
289
 
@@ -294,7 +294,7 @@ module Square
294
294
  # @param [ResumeSubscriptionRequest] body Required parameter: An object
295
295
  # containing the fields to POST for the request. See the corresponding
296
296
  # object definition for field details.
297
- # @return [ResumeSubscriptionResponse Hash] response from the API call
297
+ # @return [ApiResponse] the complete http response with raw body and status code.
298
298
  def resume_subscription(subscription_id:,
299
299
  body:)
300
300
  new_api_call_builder
@@ -309,9 +309,9 @@ module Square
309
309
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
310
310
  .auth(Single.new('global')))
311
311
  .response(new_response_handler
312
- .deserializer(APIHelper.method(:json_deserialize))
313
- .is_api_response(true)
314
- .convertor(ApiResponse.method(:create)))
312
+ .deserializer(APIHelper.method(:json_deserialize))
313
+ .is_api_response(true)
314
+ .convertor(ApiResponse.method(:create)))
315
315
  .execute
316
316
  end
317
317
 
@@ -325,7 +325,7 @@ module Square
325
325
  # @param [SwapPlanRequest] body Required parameter: An object containing the
326
326
  # fields to POST for the request. See the corresponding object definition
327
327
  # for field details.
328
- # @return [SwapPlanResponse Hash] response from the API call
328
+ # @return [ApiResponse] the complete http response with raw body and status code.
329
329
  def swap_plan(subscription_id:,
330
330
  body:)
331
331
  new_api_call_builder
@@ -340,9 +340,9 @@ module Square
340
340
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
341
341
  .auth(Single.new('global')))
342
342
  .response(new_response_handler
343
- .deserializer(APIHelper.method(:json_deserialize))
344
- .is_api_response(true)
345
- .convertor(ApiResponse.method(:create)))
343
+ .deserializer(APIHelper.method(:json_deserialize))
344
+ .is_api_response(true)
345
+ .convertor(ApiResponse.method(:create)))
346
346
  .execute
347
347
  end
348
348
  end
@@ -12,7 +12,7 @@ module Square
12
12
  # @param [CreateTeamMemberRequest] body Required parameter: An object
13
13
  # containing the fields to POST for the request. See the corresponding
14
14
  # object definition for field details.
15
- # @return [CreateTeamMemberResponse Hash] response from the API call
15
+ # @return [ApiResponse] the complete http response with raw body and status code.
16
16
  def create_team_member(body:)
17
17
  new_api_call_builder
18
18
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -24,9 +24,9 @@ module Square
24
24
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
25
25
  .auth(Single.new('global')))
26
26
  .response(new_response_handler
27
- .deserializer(APIHelper.method(:json_deserialize))
28
- .is_api_response(true)
29
- .convertor(ApiResponse.method(:create)))
27
+ .deserializer(APIHelper.method(:json_deserialize))
28
+ .is_api_response(true)
29
+ .convertor(ApiResponse.method(:create)))
30
30
  .execute
31
31
  end
32
32
 
@@ -43,7 +43,7 @@ module Square
43
43
  # @param [BulkCreateTeamMembersRequest] body Required parameter: An object
44
44
  # containing the fields to POST for the request. See the corresponding
45
45
  # object definition for field details.
46
- # @return [BulkCreateTeamMembersResponse Hash] response from the API call
46
+ # @return [ApiResponse] the complete http response with raw body and status code.
47
47
  def bulk_create_team_members(body:)
48
48
  new_api_call_builder
49
49
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -55,9 +55,9 @@ module Square
55
55
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
56
56
  .auth(Single.new('global')))
57
57
  .response(new_response_handler
58
- .deserializer(APIHelper.method(:json_deserialize))
59
- .is_api_response(true)
60
- .convertor(ApiResponse.method(:create)))
58
+ .deserializer(APIHelper.method(:json_deserialize))
59
+ .is_api_response(true)
60
+ .convertor(ApiResponse.method(:create)))
61
61
  .execute
62
62
  end
63
63
 
@@ -74,7 +74,7 @@ module Square
74
74
  # @param [BulkUpdateTeamMembersRequest] 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 [BulkUpdateTeamMembersResponse Hash] response from the API call
77
+ # @return [ApiResponse] the complete http response with raw body and status code.
78
78
  def bulk_update_team_members(body:)
79
79
  new_api_call_builder
80
80
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -86,20 +86,119 @@ 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
+ .execute
93
+ end
94
+
95
+ # Lists jobs in a seller account. Results are sorted by title in ascending
96
+ # order.
97
+ # @param [String] cursor Optional parameter: The pagination cursor returned
98
+ # by the previous call to this endpoint. Provide this cursor to retrieve the
99
+ # next page of results for your original request. For more information, see
100
+ # [Pagination](https://developer.squareup.com/docs/build-basics/common-api-p
101
+ # atterns/pagination).
102
+ # @return [ApiResponse] the complete http response with raw body and status code.
103
+ def list_jobs(cursor: nil)
104
+ new_api_call_builder
105
+ .request(new_request_builder(HttpMethodEnum::GET,
106
+ '/v2/team-members/jobs',
107
+ 'default')
108
+ .query_param(new_parameter(cursor, key: 'cursor'))
109
+ .header_param(new_parameter('application/json', key: 'accept'))
110
+ .auth(Single.new('global')))
111
+ .response(new_response_handler
112
+ .deserializer(APIHelper.method(:json_deserialize))
113
+ .is_api_response(true)
114
+ .convertor(ApiResponse.method(:create)))
115
+ .execute
116
+ end
117
+
118
+ # Creates a job in a seller account. A job defines a title and tip
119
+ # eligibility. Note that
120
+ # compensation is defined in a [job assignment]($m/JobAssignment) in a team
121
+ # member's wage setting.
122
+ # @param [CreateJobRequest] body Required parameter: An object containing
123
+ # the fields to POST for the request. See the corresponding object
124
+ # definition for field details.
125
+ # @return [ApiResponse] the complete http response with raw body and status code.
126
+ def create_job(body:)
127
+ new_api_call_builder
128
+ .request(new_request_builder(HttpMethodEnum::POST,
129
+ '/v2/team-members/jobs',
130
+ 'default')
131
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
132
+ .body_param(new_parameter(body))
133
+ .header_param(new_parameter('application/json', key: 'accept'))
134
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
135
+ .auth(Single.new('global')))
136
+ .response(new_response_handler
137
+ .deserializer(APIHelper.method(:json_deserialize))
138
+ .is_api_response(true)
139
+ .convertor(ApiResponse.method(:create)))
140
+ .execute
141
+ end
142
+
143
+ # Retrieves a specified job.
144
+ # @param [String] job_id Required parameter: The ID of the job to
145
+ # retrieve.
146
+ # @return [ApiResponse] the complete http response with raw body and status code.
147
+ def retrieve_job(job_id:)
148
+ new_api_call_builder
149
+ .request(new_request_builder(HttpMethodEnum::GET,
150
+ '/v2/team-members/jobs/{job_id}',
151
+ 'default')
152
+ .template_param(new_parameter(job_id, key: 'job_id')
153
+ .should_encode(true))
154
+ .header_param(new_parameter('application/json', key: 'accept'))
155
+ .auth(Single.new('global')))
156
+ .response(new_response_handler
157
+ .deserializer(APIHelper.method(:json_deserialize))
158
+ .is_api_response(true)
159
+ .convertor(ApiResponse.method(:create)))
160
+ .execute
161
+ end
162
+
163
+ # Updates the title or tip eligibility of a job. Changes to the title
164
+ # propagate to all
165
+ # `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the
166
+ # job ID. Changes to
167
+ # tip eligibility propagate to all `TeamMemberWage` objects that reference
168
+ # the job ID.
169
+ # @param [String] job_id Required parameter: The ID of the job to update.
170
+ # @param [UpdateJobRequest] body Required parameter: An object containing
171
+ # the fields to POST for the request. See the corresponding object
172
+ # definition for field details.
173
+ # @return [ApiResponse] the complete http response with raw body and status code.
174
+ def update_job(job_id:,
175
+ body:)
176
+ new_api_call_builder
177
+ .request(new_request_builder(HttpMethodEnum::PUT,
178
+ '/v2/team-members/jobs/{job_id}',
179
+ 'default')
180
+ .template_param(new_parameter(job_id, key: 'job_id')
181
+ .should_encode(true))
182
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
183
+ .body_param(new_parameter(body))
184
+ .header_param(new_parameter('application/json', key: 'accept'))
185
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
186
+ .auth(Single.new('global')))
187
+ .response(new_response_handler
188
+ .deserializer(APIHelper.method(:json_deserialize))
189
+ .is_api_response(true)
190
+ .convertor(ApiResponse.method(:create)))
92
191
  .execute
93
192
  end
94
193
 
95
194
  # Returns a paginated list of `TeamMember` objects for a business.
96
- # The list can be filtered by the following:
97
- # - location IDs
98
- # - `status`
195
+ # The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status,
196
+ # or whether
197
+ # the team member is the Square account owner.
99
198
  # @param [SearchTeamMembersRequest] body Required parameter: An object
100
199
  # containing the fields to POST for the request. See the corresponding
101
200
  # object definition for field details.
102
- # @return [SearchTeamMembersResponse Hash] response from the API call
201
+ # @return [ApiResponse] the complete http response with raw body and status code.
103
202
  def search_team_members(body:)
104
203
  new_api_call_builder
105
204
  .request(new_request_builder(HttpMethodEnum::POST,
@@ -111,9 +210,9 @@ module Square
111
210
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
112
211
  .auth(Single.new('global')))
113
212
  .response(new_response_handler
114
- .deserializer(APIHelper.method(:json_deserialize))
115
- .is_api_response(true)
116
- .convertor(ApiResponse.method(:create)))
213
+ .deserializer(APIHelper.method(:json_deserialize))
214
+ .is_api_response(true)
215
+ .convertor(ApiResponse.method(:create)))
117
216
  .execute
118
217
  end
119
218
 
@@ -123,7 +222,7 @@ module Square
123
222
  # eam-member).
124
223
  # @param [String] team_member_id Required parameter: The ID of the team
125
224
  # member to retrieve.
126
- # @return [RetrieveTeamMemberResponse Hash] response from the API call
225
+ # @return [ApiResponse] the complete http response with raw body and status code.
127
226
  def retrieve_team_member(team_member_id:)
128
227
  new_api_call_builder
129
228
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -134,9 +233,9 @@ module Square
134
233
  .header_param(new_parameter('application/json', key: 'accept'))
135
234
  .auth(Single.new('global')))
136
235
  .response(new_response_handler
137
- .deserializer(APIHelper.method(:json_deserialize))
138
- .is_api_response(true)
139
- .convertor(ApiResponse.method(:create)))
236
+ .deserializer(APIHelper.method(:json_deserialize))
237
+ .is_api_response(true)
238
+ .convertor(ApiResponse.method(:create)))
140
239
  .execute
141
240
  end
142
241
 
@@ -150,7 +249,7 @@ module Square
150
249
  # @param [UpdateTeamMemberRequest] body Required parameter: An object
151
250
  # containing the fields to POST for the request. See the corresponding
152
251
  # object definition for field details.
153
- # @return [UpdateTeamMemberResponse Hash] response from the API call
252
+ # @return [ApiResponse] the complete http response with raw body and status code.
154
253
  def update_team_member(team_member_id:,
155
254
  body:)
156
255
  new_api_call_builder
@@ -165,20 +264,23 @@ module Square
165
264
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
166
265
  .auth(Single.new('global')))
167
266
  .response(new_response_handler
168
- .deserializer(APIHelper.method(:json_deserialize))
169
- .is_api_response(true)
170
- .convertor(ApiResponse.method(:create)))
267
+ .deserializer(APIHelper.method(:json_deserialize))
268
+ .is_api_response(true)
269
+ .convertor(ApiResponse.method(:create)))
171
270
  .execute
172
271
  end
173
272
 
174
273
  # Retrieves a `WageSetting` object for a team member specified
175
- # by `TeamMember.id`.
176
- # Learn about [Troubleshooting the Team
274
+ # by `TeamMember.id`. For more information, see
275
+ # [Troubleshooting the Team
177
276
  # API](https://developer.squareup.com/docs/team/troubleshooting#retrievewage
178
277
  # setting).
278
+ # Square recommends using [RetrieveTeamMember]($e/Team/RetrieveTeamMember)
279
+ # or [SearchTeamMembers]($e/Team/SearchTeamMembers)
280
+ # to get this information directly from the `TeamMember.wage_setting` field.
179
281
  # @param [String] team_member_id Required parameter: The ID of the team
180
282
  # member for which to retrieve the wage setting.
181
- # @return [RetrieveWageSettingResponse Hash] response from the API call
283
+ # @return [ApiResponse] the complete http response with raw body and status code.
182
284
  def retrieve_wage_setting(team_member_id:)
183
285
  new_api_call_builder
184
286
  .request(new_request_builder(HttpMethodEnum::GET,
@@ -189,26 +291,30 @@ module Square
189
291
  .header_param(new_parameter('application/json', key: 'accept'))
190
292
  .auth(Single.new('global')))
191
293
  .response(new_response_handler
192
- .deserializer(APIHelper.method(:json_deserialize))
193
- .is_api_response(true)
194
- .convertor(ApiResponse.method(:create)))
294
+ .deserializer(APIHelper.method(:json_deserialize))
295
+ .is_api_response(true)
296
+ .convertor(ApiResponse.method(:create)))
195
297
  .execute
196
298
  end
197
299
 
198
300
  # Creates or updates a `WageSetting` object. The object is created if a
199
- # `WageSetting` with the specified `team_member_id` does not exist.
301
+ # `WageSetting` with the specified `team_member_id` doesn't exist.
200
302
  # Otherwise,
201
303
  # it fully replaces the `WageSetting` object for the team member.
202
- # The `WageSetting` is returned on a successful update.
203
- # Learn about [Troubleshooting the Team
304
+ # The `WageSetting` is returned on a successful update. For more
305
+ # information, see
306
+ # [Troubleshooting the Team
204
307
  # API](https://developer.squareup.com/docs/team/troubleshooting#create-or-up
205
308
  # date-a-wage-setting).
309
+ # Square recommends using [CreateTeamMember]($e/Team/CreateTeamMember) or
310
+ # [UpdateTeamMember]($e/Team/UpdateTeamMember)
311
+ # to manage the `TeamMember.wage_setting` field directly.
206
312
  # @param [String] team_member_id Required parameter: The ID of the team
207
313
  # member for which to update the `WageSetting` object.
208
314
  # @param [UpdateWageSettingRequest] body Required parameter: An object
209
315
  # containing the fields to POST for the request. See the corresponding
210
316
  # object definition for field details.
211
- # @return [UpdateWageSettingResponse Hash] response from the API call
317
+ # @return [ApiResponse] the complete http response with raw body and status code.
212
318
  def update_wage_setting(team_member_id:,
213
319
  body:)
214
320
  new_api_call_builder
@@ -223,9 +329,9 @@ module Square
223
329
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
224
330
  .auth(Single.new('global')))
225
331
  .response(new_response_handler
226
- .deserializer(APIHelper.method(:json_deserialize))
227
- .is_api_response(true)
228
- .convertor(ApiResponse.method(:create)))
332
+ .deserializer(APIHelper.method(:json_deserialize))
333
+ .is_api_response(true)
334
+ .convertor(ApiResponse.method(:create)))
229
335
  .execute
230
336
  end
231
337
  end