square.rb 26.1.0.20230119 → 27.0.0.20230419
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.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/square/api/apple_pay_api.rb +14 -30
- data/lib/square/api/bank_accounts_api.rb +40 -90
- data/lib/square/api/base_api.rb +42 -42
- data/lib/square/api/booking_custom_attributes_api.rb +171 -336
- data/lib/square/api/bookings_api.rb +140 -263
- data/lib/square/api/cards_api.rb +58 -120
- data/lib/square/api/cash_drawers_api.rb +47 -103
- data/lib/square/api/catalog_api.rb +200 -426
- data/lib/square/api/checkout_api.rb +86 -176
- data/lib/square/api/customer_custom_attributes_api.rb +157 -310
- data/lib/square/api/customer_groups_api.rb +69 -145
- data/lib/square/api/customer_segments_api.rb +26 -61
- data/lib/square/api/customers_api.rb +147 -294
- data/lib/square/api/devices_api.rb +42 -89
- data/lib/square/api/disputes_api.rb +132 -290
- data/lib/square/api/employees_api.rb +28 -63
- data/lib/square/api/gift_card_activities_api.rb +34 -66
- data/lib/square/api/gift_cards_api.rb +109 -207
- data/lib/square/api/inventory_api.rb +204 -391
- data/lib/square/api/invoices_api.rb +121 -240
- data/lib/square/api/labor_api.rb +223 -459
- data/lib/square/api/location_custom_attributes_api.rb +173 -338
- data/lib/square/api/locations_api.rb +54 -112
- data/lib/square/api/loyalty_api.rb +283 -535
- data/lib/square/api/merchants_api.rb +25 -60
- data/lib/square/api/mobile_authorization_api.rb +14 -30
- data/lib/square/api/o_auth_api.rb +54 -109
- data/lib/square/api/order_custom_attributes_api.rb +174 -339
- data/lib/square/api/orders_api.rb +115 -222
- data/lib/square/api/payments_api.rb +118 -217
- data/lib/square/api/payouts_api.rb +54 -107
- data/lib/square/api/refunds_api.rb +59 -104
- data/lib/square/api/sites_api.rb +11 -28
- data/lib/square/api/snippets_api.rb +42 -90
- data/lib/square/api/subscriptions_api.rb +150 -299
- data/lib/square/api/team_api.rb +114 -224
- data/lib/square/api/terminal_api.rb +162 -328
- data/lib/square/api/transactions_api.rb +64 -128
- data/lib/square/api/v1_transactions_api.rb +155 -296
- data/lib/square/api/vendors_api.rb +100 -193
- data/lib/square/api/webhook_subscriptions_api.rb +124 -244
- data/lib/square/api_helper.rb +1 -437
- data/lib/square/client.rb +77 -47
- data/lib/square/configuration.rb +28 -53
- data/lib/square/exceptions/api_exception.rb +1 -11
- data/lib/square/http/api_response.rb +13 -19
- data/lib/square/http/auth/o_auth2.rb +14 -7
- data/lib/square/http/http_call_back.rb +1 -15
- data/lib/square/http/http_method_enum.rb +1 -4
- data/lib/square/http/http_request.rb +1 -45
- data/lib/square/http/http_response.rb +1 -20
- data/lib/square/utilities/date_time_helper.rb +1 -146
- data/lib/square/utilities/file_wrapper.rb +5 -5
- data/lib/square.rb +6 -6
- data/spec/user_journey_spec.rb +2 -2
- data/test/api/api_test_base.rb +13 -5
- data/test/api/test_catalog_api.rb +5 -4
- data/test/api/test_customers_api.rb +3 -2
- data/test/api/test_employees_api.rb +4 -3
- data/test/api/test_labor_api.rb +6 -5
- data/test/api/test_locations_api.rb +3 -2
- data/test/api/test_merchants_api.rb +4 -3
- data/test/api/test_payments_api.rb +4 -3
- data/test/api/test_refunds_api.rb +4 -3
- metadata +11 -111
- data/lib/square/exceptions/validation_exception.rb +0 -13
- data/lib/square/http/faraday_client.rb +0 -93
- data/lib/square/http/http_client.rb +0 -118
- data/test/test_helper.rb +0 -89
@@ -1,10 +1,6 @@
|
|
1
1
|
module Square
|
2
2
|
# BookingsApi
|
3
3
|
class BookingsApi < BaseApi
|
4
|
-
def initialize(config, http_call_back: nil)
|
5
|
-
super(config, http_call_back: http_call_back)
|
6
|
-
end
|
7
|
-
|
8
4
|
# Retrieve a collection of bookings.
|
9
5
|
# To call this endpoint with buyer-level permissions, set
|
10
6
|
# `APPOINTMENTS_READ` for the OAuth scope.
|
@@ -34,42 +30,32 @@ module Square
|
|
34
30
|
location_id: nil,
|
35
31
|
start_at_min: nil,
|
36
32
|
start_at_max: nil)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
}
|
55
|
-
|
56
|
-
# Prepare and execute HttpRequest.
|
57
|
-
_request = config.http_client.get(
|
58
|
-
_query_url,
|
59
|
-
headers: _headers
|
60
|
-
)
|
61
|
-
OAuth2.apply(config, _request)
|
62
|
-
_response = execute_request(_request)
|
63
|
-
|
64
|
-
# Return appropriate response type.
|
65
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
66
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
67
|
-
ApiResponse.new(
|
68
|
-
_response, data: decoded, errors: _errors
|
69
|
-
)
|
33
|
+
new_api_call_builder
|
34
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
35
|
+
'/v2/bookings',
|
36
|
+
'default')
|
37
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
38
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
39
|
+
.query_param(new_parameter(team_member_id, key: 'team_member_id'))
|
40
|
+
.query_param(new_parameter(location_id, key: 'location_id'))
|
41
|
+
.query_param(new_parameter(start_at_min, key: 'start_at_min'))
|
42
|
+
.query_param(new_parameter(start_at_max, key: 'start_at_max'))
|
43
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
44
|
+
.auth(Single.new('global')))
|
45
|
+
.response(new_response_handler
|
46
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
47
|
+
.is_api_response(true)
|
48
|
+
.convertor(ApiResponse.method(:create)))
|
49
|
+
.execute
|
70
50
|
end
|
71
51
|
|
72
52
|
# Creates a booking.
|
53
|
+
# The required input must include the following:
|
54
|
+
# - `Booking.location_id`
|
55
|
+
# - `Booking.start_at`
|
56
|
+
# - `Booking.team_member_id`
|
57
|
+
# - `Booking.AppointmentSegment.service_variation_id`
|
58
|
+
# - `Booking.AppointmentSegment.service_variation_version`
|
73
59
|
# To call this endpoint with buyer-level permissions, set
|
74
60
|
# `APPOINTMENTS_WRITE` for the OAuth scope.
|
75
61
|
# To call this endpoint with seller-level permissions, set
|
@@ -82,32 +68,20 @@ module Square
|
|
82
68
|
# object definition for field details.
|
83
69
|
# @return [CreateBookingResponse Hash] response from the API call
|
84
70
|
def create_booking(body:)
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
headers: _headers,
|
100
|
-
parameters: body.to_json
|
101
|
-
)
|
102
|
-
OAuth2.apply(config, _request)
|
103
|
-
_response = execute_request(_request)
|
104
|
-
|
105
|
-
# Return appropriate response type.
|
106
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
107
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
108
|
-
ApiResponse.new(
|
109
|
-
_response, data: decoded, errors: _errors
|
110
|
-
)
|
71
|
+
new_api_call_builder
|
72
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
73
|
+
'/v2/bookings',
|
74
|
+
'default')
|
75
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
76
|
+
.body_param(new_parameter(body))
|
77
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
78
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
79
|
+
.auth(Single.new('global')))
|
80
|
+
.response(new_response_handler
|
81
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
82
|
+
.is_api_response(true)
|
83
|
+
.convertor(ApiResponse.method(:create)))
|
84
|
+
.execute
|
111
85
|
end
|
112
86
|
|
113
87
|
# Searches for availabilities for booking.
|
@@ -120,61 +94,36 @@ module Square
|
|
120
94
|
# object definition for field details.
|
121
95
|
# @return [SearchAvailabilityResponse Hash] response from the API call
|
122
96
|
def search_availability(body:)
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
headers: _headers,
|
138
|
-
parameters: body.to_json
|
139
|
-
)
|
140
|
-
OAuth2.apply(config, _request)
|
141
|
-
_response = execute_request(_request)
|
142
|
-
|
143
|
-
# Return appropriate response type.
|
144
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
145
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
146
|
-
ApiResponse.new(
|
147
|
-
_response, data: decoded, errors: _errors
|
148
|
-
)
|
97
|
+
new_api_call_builder
|
98
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
99
|
+
'/v2/bookings/availability/search',
|
100
|
+
'default')
|
101
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
102
|
+
.body_param(new_parameter(body))
|
103
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
104
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
105
|
+
.auth(Single.new('global')))
|
106
|
+
.response(new_response_handler
|
107
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
108
|
+
.is_api_response(true)
|
109
|
+
.convertor(ApiResponse.method(:create)))
|
110
|
+
.execute
|
149
111
|
end
|
150
112
|
|
151
113
|
# Retrieves a seller's booking profile.
|
152
114
|
# @return [RetrieveBusinessBookingProfileResponse Hash] response from the API call
|
153
115
|
def retrieve_business_booking_profile
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
_request = config.http_client.get(
|
166
|
-
_query_url,
|
167
|
-
headers: _headers
|
168
|
-
)
|
169
|
-
OAuth2.apply(config, _request)
|
170
|
-
_response = execute_request(_request)
|
171
|
-
|
172
|
-
# Return appropriate response type.
|
173
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
174
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
175
|
-
ApiResponse.new(
|
176
|
-
_response, data: decoded, errors: _errors
|
177
|
-
)
|
116
|
+
new_api_call_builder
|
117
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
118
|
+
'/v2/bookings/business-booking-profile',
|
119
|
+
'default')
|
120
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
121
|
+
.auth(Single.new('global')))
|
122
|
+
.response(new_response_handler
|
123
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
124
|
+
.is_api_response(true)
|
125
|
+
.convertor(ApiResponse.method(:create)))
|
126
|
+
.execute
|
178
127
|
end
|
179
128
|
|
180
129
|
# Lists booking profiles for team members.
|
@@ -194,37 +143,21 @@ module Square
|
|
194
143
|
limit: nil,
|
195
144
|
cursor: nil,
|
196
145
|
location_id: nil)
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
}
|
213
|
-
|
214
|
-
# Prepare and execute HttpRequest.
|
215
|
-
_request = config.http_client.get(
|
216
|
-
_query_url,
|
217
|
-
headers: _headers
|
218
|
-
)
|
219
|
-
OAuth2.apply(config, _request)
|
220
|
-
_response = execute_request(_request)
|
221
|
-
|
222
|
-
# Return appropriate response type.
|
223
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
224
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
225
|
-
ApiResponse.new(
|
226
|
-
_response, data: decoded, errors: _errors
|
227
|
-
)
|
146
|
+
new_api_call_builder
|
147
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
148
|
+
'/v2/bookings/team-member-booking-profiles',
|
149
|
+
'default')
|
150
|
+
.query_param(new_parameter(bookable_only, key: 'bookable_only'))
|
151
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
152
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
153
|
+
.query_param(new_parameter(location_id, key: 'location_id'))
|
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
|
228
161
|
end
|
229
162
|
|
230
163
|
# Retrieves a team member's booking profile.
|
@@ -232,34 +165,19 @@ module Square
|
|
232
165
|
# member to retrieve.
|
233
166
|
# @return [RetrieveTeamMemberBookingProfileResponse Hash] response from the API call
|
234
167
|
def retrieve_team_member_booking_profile(team_member_id:)
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
# Prepare and execute HttpRequest.
|
250
|
-
_request = config.http_client.get(
|
251
|
-
_query_url,
|
252
|
-
headers: _headers
|
253
|
-
)
|
254
|
-
OAuth2.apply(config, _request)
|
255
|
-
_response = execute_request(_request)
|
256
|
-
|
257
|
-
# Return appropriate response type.
|
258
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
259
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
260
|
-
ApiResponse.new(
|
261
|
-
_response, data: decoded, errors: _errors
|
262
|
-
)
|
168
|
+
new_api_call_builder
|
169
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
170
|
+
'/v2/bookings/team-member-booking-profiles/{team_member_id}',
|
171
|
+
'default')
|
172
|
+
.template_param(new_parameter(team_member_id, key: 'team_member_id')
|
173
|
+
.should_encode(true))
|
174
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
175
|
+
.auth(Single.new('global')))
|
176
|
+
.response(new_response_handler
|
177
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
178
|
+
.is_api_response(true)
|
179
|
+
.convertor(ApiResponse.method(:create)))
|
180
|
+
.execute
|
263
181
|
end
|
264
182
|
|
265
183
|
# Retrieves a booking.
|
@@ -268,37 +186,23 @@ module Square
|
|
268
186
|
# To call this endpoint with seller-level permissions, set
|
269
187
|
# `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
|
270
188
|
# @param [String] booking_id Required parameter: The ID of the
|
271
|
-
# [Booking](
|
189
|
+
# [Booking](entity:Booking) object representing the to-be-retrieved
|
190
|
+
# booking.
|
272
191
|
# @return [RetrieveBookingResponse Hash] response from the API call
|
273
192
|
def retrieve_booking(booking_id:)
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
# Prepare and execute HttpRequest.
|
289
|
-
_request = config.http_client.get(
|
290
|
-
_query_url,
|
291
|
-
headers: _headers
|
292
|
-
)
|
293
|
-
OAuth2.apply(config, _request)
|
294
|
-
_response = execute_request(_request)
|
295
|
-
|
296
|
-
# Return appropriate response type.
|
297
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
298
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
299
|
-
ApiResponse.new(
|
300
|
-
_response, data: decoded, errors: _errors
|
301
|
-
)
|
193
|
+
new_api_call_builder
|
194
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
195
|
+
'/v2/bookings/{booking_id}',
|
196
|
+
'default')
|
197
|
+
.template_param(new_parameter(booking_id, key: 'booking_id')
|
198
|
+
.should_encode(true))
|
199
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
200
|
+
.auth(Single.new('global')))
|
201
|
+
.response(new_response_handler
|
202
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
203
|
+
.is_api_response(true)
|
204
|
+
.convertor(ApiResponse.method(:create)))
|
205
|
+
.execute
|
302
206
|
end
|
303
207
|
|
304
208
|
# Updates a booking.
|
@@ -310,43 +214,29 @@ module Square
|
|
310
214
|
# seller must have subscribed to *Appointments Plus*
|
311
215
|
# or *Appointments Premium*.
|
312
216
|
# @param [String] booking_id Required parameter: The ID of the
|
313
|
-
# [Booking](
|
217
|
+
# [Booking](entity:Booking) object representing the to-be-updated booking.
|
314
218
|
# @param [UpdateBookingRequest] body Required parameter: An object
|
315
219
|
# containing the fields to POST for the request. See the corresponding
|
316
220
|
# object definition for field details.
|
317
221
|
# @return [UpdateBookingResponse Hash] response from the API call
|
318
222
|
def update_booking(booking_id:,
|
319
223
|
body:)
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
_request = config.http_client.put(
|
337
|
-
_query_url,
|
338
|
-
headers: _headers,
|
339
|
-
parameters: body.to_json
|
340
|
-
)
|
341
|
-
OAuth2.apply(config, _request)
|
342
|
-
_response = execute_request(_request)
|
343
|
-
|
344
|
-
# Return appropriate response type.
|
345
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
346
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
347
|
-
ApiResponse.new(
|
348
|
-
_response, data: decoded, errors: _errors
|
349
|
-
)
|
224
|
+
new_api_call_builder
|
225
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
226
|
+
'/v2/bookings/{booking_id}',
|
227
|
+
'default')
|
228
|
+
.template_param(new_parameter(booking_id, key: 'booking_id')
|
229
|
+
.should_encode(true))
|
230
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
231
|
+
.body_param(new_parameter(body))
|
232
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
233
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
234
|
+
.auth(Single.new('global')))
|
235
|
+
.response(new_response_handler
|
236
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
237
|
+
.is_api_response(true)
|
238
|
+
.convertor(ApiResponse.method(:create)))
|
239
|
+
.execute
|
350
240
|
end
|
351
241
|
|
352
242
|
# Cancels an existing booking.
|
@@ -358,43 +248,30 @@ module Square
|
|
358
248
|
# seller must have subscribed to *Appointments Plus*
|
359
249
|
# or *Appointments Premium*.
|
360
250
|
# @param [String] booking_id Required parameter: The ID of the
|
361
|
-
# [Booking](
|
251
|
+
# [Booking](entity:Booking) object representing the to-be-cancelled
|
252
|
+
# booking.
|
362
253
|
# @param [CancelBookingRequest] body Required parameter: An object
|
363
254
|
# containing the fields to POST for the request. See the corresponding
|
364
255
|
# object definition for field details.
|
365
256
|
# @return [CancelBookingResponse Hash] response from the API call
|
366
257
|
def cancel_booking(booking_id:,
|
367
258
|
body:)
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
_request = config.http_client.post(
|
385
|
-
_query_url,
|
386
|
-
headers: _headers,
|
387
|
-
parameters: body.to_json
|
388
|
-
)
|
389
|
-
OAuth2.apply(config, _request)
|
390
|
-
_response = execute_request(_request)
|
391
|
-
|
392
|
-
# Return appropriate response type.
|
393
|
-
decoded = APIHelper.json_deserialize(_response.raw_body)
|
394
|
-
_errors = APIHelper.map_response(decoded, ['errors'])
|
395
|
-
ApiResponse.new(
|
396
|
-
_response, data: decoded, errors: _errors
|
397
|
-
)
|
259
|
+
new_api_call_builder
|
260
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
261
|
+
'/v2/bookings/{booking_id}/cancel',
|
262
|
+
'default')
|
263
|
+
.template_param(new_parameter(booking_id, key: 'booking_id')
|
264
|
+
.should_encode(true))
|
265
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
266
|
+
.body_param(new_parameter(body))
|
267
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
268
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
269
|
+
.auth(Single.new('global')))
|
270
|
+
.response(new_response_handler
|
271
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
272
|
+
.is_api_response(true)
|
273
|
+
.convertor(ApiResponse.method(:create)))
|
274
|
+
.execute
|
398
275
|
end
|
399
276
|
end
|
400
277
|
end
|