testerhjnew 1.1.0

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 +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +55 -0
  4. data/lib/tester.rb +56 -0
  5. data/lib/tester/api_helper.rb +261 -0
  6. data/lib/tester/configuration.rb +66 -0
  7. data/lib/tester/controllers/base_controller.rb +59 -0
  8. data/lib/tester/controllers/body_params_controller.rb +1270 -0
  9. data/lib/tester/controllers/echo_controller.rb +134 -0
  10. data/lib/tester/controllers/error_codes_controller.rb +179 -0
  11. data/lib/tester/controllers/form_params_controller.rb +1391 -0
  12. data/lib/tester/controllers/header_controller.rb +63 -0
  13. data/lib/tester/controllers/query_param_controller.rb +779 -0
  14. data/lib/tester/controllers/response_types_controller.rb +717 -0
  15. data/lib/tester/controllers/template_params_controller.rb +93 -0
  16. data/lib/tester/exceptions/api_exception.rb +18 -0
  17. data/lib/tester/exceptions/global_test_exception.rb +32 -0
  18. data/lib/tester/exceptions/local_test_exception.rb +30 -0
  19. data/lib/tester/exceptions/nested_model_exception.rb +37 -0
  20. data/lib/tester/http/faraday_client.rb +55 -0
  21. data/lib/tester/http/http_call_back.rb +22 -0
  22. data/lib/tester/http/http_client.rb +92 -0
  23. data/lib/tester/http/http_context.rb +18 -0
  24. data/lib/tester/http/http_method_enum.rb +11 -0
  25. data/lib/tester/http/http_request.rb +48 -0
  26. data/lib/tester/http/http_response.rb +21 -0
  27. data/lib/tester/models/additional_model_parameters.rb +70 -0
  28. data/lib/tester/models/base_model.rb +52 -0
  29. data/lib/tester/models/boss.rb +129 -0
  30. data/lib/tester/models/days.rb +30 -0
  31. data/lib/tester/models/delete_body.rb +52 -0
  32. data/lib/tester/models/echo_response.rb +88 -0
  33. data/lib/tester/models/employee.rb +155 -0
  34. data/lib/tester/models/job.rb +43 -0
  35. data/lib/tester/models/person.rb +113 -0
  36. data/lib/tester/models/query_parameter.rb +43 -0
  37. data/lib/tester/models/server_response.rb +61 -0
  38. data/lib/tester/models/suite_code.rb +21 -0
  39. data/lib/tester/models/test_nstring_encoding.rb +52 -0
  40. data/lib/tester/models/test_r_nstring_encoding.rb +52 -0
  41. data/lib/tester/models/test_rstring_encoding.rb +52 -0
  42. data/lib/tester/models/validate.rb +61 -0
  43. data/lib/tester/tester_client.rb +61 -0
  44. data/test/controllers/controller_test_base.rb +33 -0
  45. data/test/controllers/test_body_params_controller.rb +1210 -0
  46. data/test/controllers/test_echo_controller.rb +29 -0
  47. data/test/controllers/test_error_codes_controller.rb +47 -0
  48. data/test/controllers/test_form_params_controller.rb +1099 -0
  49. data/test/controllers/test_header_controller.rb +30 -0
  50. data/test/controllers/test_query_param_controller.rb +345 -0
  51. data/test/controllers/test_response_types_controller.rb +429 -0
  52. data/test/controllers/test_template_params_controller.rb +47 -0
  53. data/test/http_response_catcher.rb +16 -0
  54. data/test/test_helper.rb +91 -0
  55. metadata +178 -0
@@ -0,0 +1,59 @@
1
+ # This file was automatically generated for Stamplay by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module Tester
5
+ # Base controller.
6
+ class BaseController
7
+ attr_accessor :http_client, :http_call_back
8
+
9
+ def initialize(http_client: nil, http_call_back: nil)
10
+ @http_client = http_client || FaradayClient.new
11
+ @http_call_back = http_call_back
12
+
13
+ @global_headers = {
14
+ 'user-agent' => 'Stamplay SDK'
15
+ }
16
+ end
17
+
18
+ def validate_parameters(args)
19
+ args.each do |_name, value|
20
+ if value.nil?
21
+ raise ArgumentError, "Required parameter #{_name} cannot be nil."
22
+ end
23
+ end
24
+ end
25
+
26
+ def execute_request(request, binary: false)
27
+ @http_call_back.on_before_request(request) if @http_call_back
28
+
29
+ APIHelper.clean_hash(request.headers)
30
+ request.headers = @global_headers.clone.merge(request.headers)
31
+
32
+ response = if binary
33
+ @http_client.execute_as_binary(request)
34
+ else
35
+ @http_client.execute_as_string(request)
36
+ end
37
+ context = HttpContext.new(request, response)
38
+
39
+ @http_call_back.on_after_response(context) if @http_call_back
40
+
41
+ context
42
+ end
43
+
44
+ def validate_response(context)
45
+ raise GlobalTestException.new '400 Global', context if
46
+ context.response.status_code == 400
47
+ raise GlobalTestException.new '402 Global', context if
48
+ context.response.status_code == 402
49
+ raise GlobalTestException.new '403 Global', context if
50
+ context.response.status_code == 403
51
+ raise GlobalTestException.new '404 Global', context if
52
+ context.response.status_code == 404
53
+ raise GlobalTestException.new '500 Global', context if
54
+ context.response.status_code == 500
55
+ raise GlobalTestException.new 'Invalid response.', context unless
56
+ context.response.status_code.between?(200, 208) # [200,208] = HTTP OK
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,1270 @@
1
+ # This file was automatically generated for Stamplay by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module Tester
5
+ # BodyParamsController
6
+ class BodyParamsController < BaseController
7
+ @instance = BodyParamsController.new
8
+
9
+ class << self
10
+ attr_accessor :instance
11
+ end
12
+
13
+ def instance
14
+ self.class.instance
15
+ end
16
+
17
+ # TODO: type endpoint description here
18
+ # @param [String] text_string Required parameter: Example:
19
+ # @return ServerResponse response from the API call
20
+ def send_delete_plain_text(text_string)
21
+ # Validate required parameters.
22
+ validate_parameters(
23
+ 'text_string' => text_string
24
+ )
25
+ # Prepare query url.
26
+ _query_builder = Configuration.get_base_uri
27
+ _query_builder << '/body/deletePlainTextBody'
28
+ _query_url = APIHelper.clean_url _query_builder
29
+
30
+ # Prepare headers.
31
+ _headers = {
32
+ 'accept' => 'application/json',
33
+ 'content-type' => 'text/plain; charset=utf-8'
34
+ }
35
+
36
+ # Prepare and execute HttpRequest.
37
+ _request = @http_client.delete(
38
+ _query_url,
39
+ headers: _headers,
40
+ parameters: text_string
41
+ )
42
+ _context = execute_request(_request)
43
+
44
+ # Validate response against endpoint and global error codes.
45
+ return nil if _context.response.status_code == 404
46
+ validate_response(_context)
47
+
48
+ # Return appropriate response type.
49
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
50
+ ServerResponse.from_hash(decoded)
51
+ end
52
+
53
+ # TODO: type endpoint description here
54
+ # @param [DeleteBody] body Required parameter: Example:
55
+ # @return ServerResponse response from the API call
56
+ def send_delete_body(body)
57
+ # Validate required parameters.
58
+ validate_parameters(
59
+ 'body' => body
60
+ )
61
+ # Prepare query url.
62
+ _query_builder = Configuration.get_base_uri
63
+ _query_builder << '/body/deleteBody'
64
+ _query_url = APIHelper.clean_url _query_builder
65
+
66
+ # Prepare headers.
67
+ _headers = {
68
+ 'accept' => 'application/json',
69
+ 'content-type' => 'application/json; charset=utf-8'
70
+ }
71
+
72
+ # Prepare and execute HttpRequest.
73
+ _request = @http_client.delete(
74
+ _query_url,
75
+ headers: _headers,
76
+ parameters: body.to_json
77
+ )
78
+ _context = execute_request(_request)
79
+
80
+ # Validate response against endpoint and global error codes.
81
+ return nil if _context.response.status_code == 404
82
+ validate_response(_context)
83
+
84
+ # Return appropriate response type.
85
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
86
+ ServerResponse.from_hash(decoded)
87
+ end
88
+
89
+ # TODO: type endpoint description here
90
+ # @param [List of Date] dates Required parameter: Example:
91
+ # @return ServerResponse response from the API call
92
+ def send_date_array(dates)
93
+ # Validate required parameters.
94
+ validate_parameters(
95
+ 'dates' => dates
96
+ )
97
+ # Prepare query url.
98
+ _query_builder = Configuration.get_base_uri
99
+ _query_builder << '/body/date'
100
+ _query_builder = APIHelper.append_url_with_query_parameters(
101
+ _query_builder,
102
+ {
103
+ 'array' => true
104
+ },
105
+ array_serialization: Configuration.array_serialization
106
+ )
107
+ _query_url = APIHelper.clean_url _query_builder
108
+
109
+ # Prepare headers.
110
+ _headers = {
111
+ 'accept' => 'application/json',
112
+ 'content-type' => 'application/json; charset=utf-8'
113
+ }
114
+
115
+ # Prepare and execute HttpRequest.
116
+ _request = @http_client.post(
117
+ _query_url,
118
+ headers: _headers,
119
+ parameters: dates.to_json
120
+ )
121
+ _context = execute_request(_request)
122
+
123
+ # Validate response against endpoint and global error codes.
124
+ return nil if _context.response.status_code == 404
125
+ validate_response(_context)
126
+
127
+ # Return appropriate response type.
128
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
129
+ ServerResponse.from_hash(decoded)
130
+ end
131
+
132
+ # TODO: type endpoint description here
133
+ # @param [Date] date Required parameter: Example:
134
+ # @return ServerResponse response from the API call
135
+ def send_date(date)
136
+ # Validate required parameters.
137
+ validate_parameters(
138
+ 'date' => date
139
+ )
140
+ # Prepare query url.
141
+ _query_builder = Configuration.get_base_uri
142
+ _query_builder << '/body/date'
143
+ _query_url = APIHelper.clean_url _query_builder
144
+
145
+ # Prepare headers.
146
+ _headers = {
147
+ 'accept' => 'application/json',
148
+ 'content-type' => 'text/plain; charset=utf-8'
149
+ }
150
+
151
+ # Prepare and execute HttpRequest.
152
+ _request = @http_client.post(
153
+ _query_url,
154
+ headers: _headers,
155
+ parameters: date.to_s
156
+ )
157
+ _context = execute_request(_request)
158
+
159
+ # Validate response against endpoint and global error codes.
160
+ return nil if _context.response.status_code == 404
161
+ validate_response(_context)
162
+
163
+ # Return appropriate response type.
164
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
165
+ ServerResponse.from_hash(decoded)
166
+ end
167
+
168
+ # TODO: type endpoint description here
169
+ # @param [DateTime] datetime Required parameter: Example:
170
+ # @return ServerResponse response from the API call
171
+ def send_unix_date_time(datetime)
172
+ # Validate required parameters.
173
+ validate_parameters(
174
+ 'datetime' => datetime
175
+ )
176
+ # Prepare query url.
177
+ _query_builder = Configuration.get_base_uri
178
+ _query_builder << '/body/unixdatetime'
179
+ _query_url = APIHelper.clean_url _query_builder
180
+
181
+ # Prepare headers.
182
+ _headers = {
183
+ 'accept' => 'application/json',
184
+ 'content-type' => 'text/plain; charset=utf-8'
185
+ }
186
+
187
+ # Prepare and execute HttpRequest.
188
+ _request = @http_client.post(
189
+ _query_url,
190
+ headers: _headers,
191
+ parameters: datetime.to_time.utc.to_i.to_s
192
+ )
193
+ _context = execute_request(_request)
194
+
195
+ # Validate response against endpoint and global error codes.
196
+ return nil if _context.response.status_code == 404
197
+ validate_response(_context)
198
+
199
+ # Return appropriate response type.
200
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
201
+ ServerResponse.from_hash(decoded)
202
+ end
203
+
204
+ # TODO: type endpoint description here
205
+ # @param [DateTime] datetime Required parameter: Example:
206
+ # @return ServerResponse response from the API call
207
+ def send_rfc_1123_date_time(datetime)
208
+ # Validate required parameters.
209
+ validate_parameters(
210
+ 'datetime' => datetime
211
+ )
212
+ # Prepare query url.
213
+ _query_builder = Configuration.get_base_uri
214
+ _query_builder << '/body/rfc1123datetime'
215
+ _query_url = APIHelper.clean_url _query_builder
216
+
217
+ # Prepare headers.
218
+ _headers = {
219
+ 'accept' => 'application/json',
220
+ 'content-type' => 'text/plain; charset=utf-8'
221
+ }
222
+
223
+ # Prepare and execute HttpRequest.
224
+ _request = @http_client.post(
225
+ _query_url,
226
+ headers: _headers,
227
+ parameters: datetime.httpdate
228
+ )
229
+ _context = execute_request(_request)
230
+
231
+ # Validate response against endpoint and global error codes.
232
+ return nil if _context.response.status_code == 404
233
+ validate_response(_context)
234
+
235
+ # Return appropriate response type.
236
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
237
+ ServerResponse.from_hash(decoded)
238
+ end
239
+
240
+ # TODO: type endpoint description here
241
+ # @param [DateTime] datetime Required parameter: Example:
242
+ # @return ServerResponse response from the API call
243
+ def send_rfc_3339_date_time(datetime)
244
+ # Validate required parameters.
245
+ validate_parameters(
246
+ 'datetime' => datetime
247
+ )
248
+ # Prepare query url.
249
+ _query_builder = Configuration.get_base_uri
250
+ _query_builder << '/body/rfc3339datetime'
251
+ _query_url = APIHelper.clean_url _query_builder
252
+
253
+ # Prepare headers.
254
+ _headers = {
255
+ 'accept' => 'application/json',
256
+ 'content-type' => 'text/plain; charset=utf-8'
257
+ }
258
+
259
+ # Prepare and execute HttpRequest.
260
+ _request = @http_client.post(
261
+ _query_url,
262
+ headers: _headers,
263
+ parameters: datetime.rfc3339
264
+ )
265
+ _context = execute_request(_request)
266
+
267
+ # Validate response against endpoint and global error codes.
268
+ return nil if _context.response.status_code == 404
269
+ validate_response(_context)
270
+
271
+ # Return appropriate response type.
272
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
273
+ ServerResponse.from_hash(decoded)
274
+ end
275
+
276
+ # TODO: type endpoint description here
277
+ # @param [List of DateTime] datetimes Required parameter: Example:
278
+ # @return ServerResponse response from the API call
279
+ def send_unix_date_time_array(datetimes)
280
+ # Validate required parameters.
281
+ validate_parameters(
282
+ 'datetimes' => datetimes
283
+ )
284
+ # Prepare query url.
285
+ _query_builder = Configuration.get_base_uri
286
+ _query_builder << '/body/unixdatetime'
287
+ _query_builder = APIHelper.append_url_with_query_parameters(
288
+ _query_builder,
289
+ {
290
+ 'array' => true
291
+ },
292
+ array_serialization: Configuration.array_serialization
293
+ )
294
+ _query_url = APIHelper.clean_url _query_builder
295
+
296
+ # Prepare headers.
297
+ _headers = {
298
+ 'accept' => 'application/json',
299
+ 'content-type' => 'application/json; charset=utf-8'
300
+ }
301
+
302
+ # Prepare and execute HttpRequest.
303
+ _request = @http_client.post(
304
+ _query_url,
305
+ headers: _headers,
306
+ parameters: datetimes.map { |element| element.to_time.utc.to_i }.to_json
307
+ )
308
+ _context = execute_request(_request)
309
+
310
+ # Validate response against endpoint and global error codes.
311
+ return nil if _context.response.status_code == 404
312
+ validate_response(_context)
313
+
314
+ # Return appropriate response type.
315
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
316
+ ServerResponse.from_hash(decoded)
317
+ end
318
+
319
+ # TODO: type endpoint description here
320
+ # @param [List of DateTime] datetimes Required parameter: Example:
321
+ # @return ServerResponse response from the API call
322
+ def send_rfc_1123_date_time_array(datetimes)
323
+ # Validate required parameters.
324
+ validate_parameters(
325
+ 'datetimes' => datetimes
326
+ )
327
+ # Prepare query url.
328
+ _query_builder = Configuration.get_base_uri
329
+ _query_builder << '/body/rfc1123datetime'
330
+ _query_builder = APIHelper.append_url_with_query_parameters(
331
+ _query_builder,
332
+ {
333
+ 'array' => true
334
+ },
335
+ array_serialization: Configuration.array_serialization
336
+ )
337
+ _query_url = APIHelper.clean_url _query_builder
338
+
339
+ # Prepare headers.
340
+ _headers = {
341
+ 'accept' => 'application/json',
342
+ 'content-type' => 'application/json; charset=utf-8'
343
+ }
344
+
345
+ # Prepare and execute HttpRequest.
346
+ _request = @http_client.post(
347
+ _query_url,
348
+ headers: _headers,
349
+ parameters: datetimes.map(&:httpdate).to_json
350
+ )
351
+ _context = execute_request(_request)
352
+
353
+ # Validate response against endpoint and global error codes.
354
+ return nil if _context.response.status_code == 404
355
+ validate_response(_context)
356
+
357
+ # Return appropriate response type.
358
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
359
+ ServerResponse.from_hash(decoded)
360
+ end
361
+
362
+ # TODO: type endpoint description here
363
+ # @param [List of DateTime] datetimes Required parameter: Example:
364
+ # @return ServerResponse response from the API call
365
+ def send_rfc_3339_date_time_array(datetimes)
366
+ # Validate required parameters.
367
+ validate_parameters(
368
+ 'datetimes' => datetimes
369
+ )
370
+ # Prepare query url.
371
+ _query_builder = Configuration.get_base_uri
372
+ _query_builder << '/body/rfc3339datetime'
373
+ _query_builder = APIHelper.append_url_with_query_parameters(
374
+ _query_builder,
375
+ {
376
+ 'array' => true
377
+ },
378
+ array_serialization: Configuration.array_serialization
379
+ )
380
+ _query_url = APIHelper.clean_url _query_builder
381
+
382
+ # Prepare headers.
383
+ _headers = {
384
+ 'accept' => 'application/json',
385
+ 'content-type' => 'application/json; charset=utf-8'
386
+ }
387
+
388
+ # Prepare and execute HttpRequest.
389
+ _request = @http_client.post(
390
+ _query_url,
391
+ headers: _headers,
392
+ parameters: datetimes.map(&:rfc3339).to_json
393
+ )
394
+ _context = execute_request(_request)
395
+
396
+ # Validate response against endpoint and global error codes.
397
+ return nil if _context.response.status_code == 404
398
+ validate_response(_context)
399
+
400
+ # Return appropriate response type.
401
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
402
+ ServerResponse.from_hash(decoded)
403
+ end
404
+
405
+ # sends a string body param
406
+ # @param [List of String] sarray Required parameter: Example:
407
+ # @return ServerResponse response from the API call
408
+ def send_string_array(sarray)
409
+ # Validate required parameters.
410
+ validate_parameters(
411
+ 'sarray' => sarray
412
+ )
413
+ # Prepare query url.
414
+ _query_builder = Configuration.get_base_uri
415
+ _query_builder << '/body/string'
416
+ _query_builder = APIHelper.append_url_with_query_parameters(
417
+ _query_builder,
418
+ {
419
+ 'array' => true
420
+ },
421
+ array_serialization: Configuration.array_serialization
422
+ )
423
+ _query_url = APIHelper.clean_url _query_builder
424
+
425
+ # Prepare headers.
426
+ _headers = {
427
+ 'accept' => 'application/json',
428
+ 'content-type' => 'application/json; charset=utf-8'
429
+ }
430
+
431
+ # Prepare and execute HttpRequest.
432
+ _request = @http_client.post(
433
+ _query_url,
434
+ headers: _headers,
435
+ parameters: sarray.to_json
436
+ )
437
+ _context = execute_request(_request)
438
+
439
+ # Validate response against endpoint and global error codes.
440
+ return nil if _context.response.status_code == 404
441
+ validate_response(_context)
442
+
443
+ # Return appropriate response type.
444
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
445
+ ServerResponse.from_hash(decoded)
446
+ end
447
+
448
+ # TODO: type endpoint description here
449
+ # @param [String] value Required parameter: Example:
450
+ # @return ServerResponse response from the API call
451
+ def update_string(value)
452
+ # Validate required parameters.
453
+ validate_parameters(
454
+ 'value' => value
455
+ )
456
+ # Prepare query url.
457
+ _query_builder = Configuration.get_base_uri
458
+ _query_builder << '/body/updateString'
459
+ _query_url = APIHelper.clean_url _query_builder
460
+
461
+ # Prepare headers.
462
+ _headers = {
463
+ 'accept' => 'application/json',
464
+ 'content-type' => 'text/plain; charset=utf-8'
465
+ }
466
+
467
+ # Prepare and execute HttpRequest.
468
+ _request = @http_client.put(
469
+ _query_url,
470
+ headers: _headers,
471
+ parameters: value
472
+ )
473
+ _context = execute_request(_request)
474
+
475
+ # Validate response against endpoint and global error codes.
476
+ return nil if _context.response.status_code == 404
477
+ validate_response(_context)
478
+
479
+ # Return appropriate response type.
480
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
481
+ ServerResponse.from_hash(decoded)
482
+ end
483
+
484
+ # TODO: type endpoint description here
485
+ # @param [List of Integer] integers Required parameter: Example:
486
+ # @return ServerResponse response from the API call
487
+ def send_integer_array(integers)
488
+ # Validate required parameters.
489
+ validate_parameters(
490
+ 'integers' => integers
491
+ )
492
+ # Prepare query url.
493
+ _query_builder = Configuration.get_base_uri
494
+ _query_builder << '/body/number'
495
+ _query_builder = APIHelper.append_url_with_query_parameters(
496
+ _query_builder,
497
+ {
498
+ 'array' => true
499
+ },
500
+ array_serialization: Configuration.array_serialization
501
+ )
502
+ _query_url = APIHelper.clean_url _query_builder
503
+
504
+ # Prepare headers.
505
+ _headers = {
506
+ 'accept' => 'application/json',
507
+ 'content-type' => 'application/json; charset=utf-8'
508
+ }
509
+
510
+ # Prepare and execute HttpRequest.
511
+ _request = @http_client.post(
512
+ _query_url,
513
+ headers: _headers,
514
+ parameters: integers.to_json
515
+ )
516
+ _context = execute_request(_request)
517
+
518
+ # Validate response against endpoint and global error codes.
519
+ return nil if _context.response.status_code == 404
520
+ validate_response(_context)
521
+
522
+ # Return appropriate response type.
523
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
524
+ ServerResponse.from_hash(decoded)
525
+ end
526
+
527
+ # TODO: type endpoint description here
528
+ # @param [String] field Required parameter: Example:
529
+ # @param [String] name Required parameter: Example:
530
+ # @return ServerResponse response from the API call
531
+ def wrap_body_in_object(field,
532
+ name)
533
+ # Validate required parameters.
534
+ validate_parameters(
535
+ 'field' => field,
536
+ 'name' => name
537
+ )
538
+ # Prepare query url.
539
+ _query_builder = Configuration.get_base_uri
540
+ _query_builder << '/body/wrapParamInObject'
541
+ _query_url = APIHelper.clean_url _query_builder
542
+
543
+ # Prepare headers.
544
+ _headers = {
545
+ 'accept' => 'application/json',
546
+ 'content-type' => 'application/json; charset=utf-8'
547
+ }
548
+ # Prepare wrapper object for body parameters.
549
+ _body_parameters = {
550
+ 'field' => field,
551
+ 'name' => name
552
+ }
553
+
554
+ # Prepare and execute HttpRequest.
555
+ _request = @http_client.post(
556
+ _query_url,
557
+ headers: _headers,
558
+ parameters: _body_parameters.to_json
559
+ )
560
+ _context = execute_request(_request)
561
+
562
+ # Validate response against endpoint and global error codes.
563
+ return nil if _context.response.status_code == 404
564
+ validate_response(_context)
565
+
566
+ # Return appropriate response type.
567
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
568
+ ServerResponse.from_hash(decoded)
569
+ end
570
+
571
+ # TODO: type endpoint description here
572
+ # @param [AdditionalModelParameters] model Required parameter: Example:
573
+ # @return ServerResponse response from the API call
574
+ def additional_model_parameters(model)
575
+ # Validate required parameters.
576
+ validate_parameters(
577
+ 'model' => model
578
+ )
579
+ # Prepare query url.
580
+ _query_builder = Configuration.get_base_uri
581
+ _query_builder << '/body/additionalModelProperties'
582
+ _query_url = APIHelper.clean_url _query_builder
583
+
584
+ # Prepare headers.
585
+ _headers = {
586
+ 'accept' => 'application/json',
587
+ 'content-type' => 'application/json; charset=utf-8'
588
+ }
589
+
590
+ # Prepare and execute HttpRequest.
591
+ _request = @http_client.post(
592
+ _query_url,
593
+ headers: _headers,
594
+ parameters: model.to_json
595
+ )
596
+ _context = execute_request(_request)
597
+
598
+ # Validate response against endpoint and global error codes.
599
+ return nil if _context.response.status_code == 404
600
+ validate_response(_context)
601
+
602
+ # Return appropriate response type.
603
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
604
+ ServerResponse.from_hash(decoded)
605
+ end
606
+
607
+ # TODO: type endpoint description here
608
+ # @param [Validate] model Required parameter: Example:
609
+ # @param [String] option Optional parameter: Example:
610
+ # @return ServerResponse response from the API call
611
+ def validate_required_parameter(model,
612
+ option = nil)
613
+ # Validate required parameters.
614
+ validate_parameters(
615
+ 'model' => model
616
+ )
617
+ # Prepare query url.
618
+ _query_builder = Configuration.get_base_uri
619
+ _query_builder << '/body/validateRequiredParam'
620
+ _query_builder = APIHelper.append_url_with_query_parameters(
621
+ _query_builder,
622
+ {
623
+ 'option' => option
624
+ },
625
+ array_serialization: Configuration.array_serialization
626
+ )
627
+ _query_url = APIHelper.clean_url _query_builder
628
+
629
+ # Prepare headers.
630
+ _headers = {
631
+ 'accept' => 'application/json',
632
+ 'content-type' => 'application/json; charset=utf-8'
633
+ }
634
+
635
+ # Prepare and execute HttpRequest.
636
+ _request = @http_client.post(
637
+ _query_url,
638
+ headers: _headers,
639
+ parameters: model.to_json
640
+ )
641
+ _context = execute_request(_request)
642
+
643
+ # Validate response against endpoint and global error codes.
644
+ return nil if _context.response.status_code == 404
645
+ validate_response(_context)
646
+
647
+ # Return appropriate response type.
648
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
649
+ ServerResponse.from_hash(decoded)
650
+ end
651
+
652
+ # TODO: type endpoint description here
653
+ # @param [AdditionalModelParameters] model Required parameter: Example:
654
+ # @return ServerResponse response from the API call
655
+ def additional_model_parameters_1(model)
656
+ # Validate required parameters.
657
+ validate_parameters(
658
+ 'model' => model
659
+ )
660
+ # Prepare query url.
661
+ _query_builder = Configuration.get_base_uri
662
+ _query_builder << '/body/additionalModelProperties'
663
+ _query_url = APIHelper.clean_url _query_builder
664
+
665
+ # Prepare headers.
666
+ _headers = {
667
+ 'accept' => 'application/json',
668
+ 'content-type' => 'application/json; charset=utf-8'
669
+ }
670
+
671
+ # Prepare and execute HttpRequest.
672
+ _request = @http_client.post(
673
+ _query_url,
674
+ headers: _headers,
675
+ parameters: model.to_json
676
+ )
677
+ _context = execute_request(_request)
678
+
679
+ # Validate response against endpoint and global error codes.
680
+ return nil if _context.response.status_code == 404
681
+ validate_response(_context)
682
+
683
+ # Return appropriate response type.
684
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
685
+ ServerResponse.from_hash(decoded)
686
+ end
687
+
688
+ # TODO: type endpoint description here
689
+ # @param [Employee] model Required parameter: Example:
690
+ # @return ServerResponse response from the API call
691
+ def send_model(model)
692
+ # Validate required parameters.
693
+ validate_parameters(
694
+ 'model' => model
695
+ )
696
+ # Prepare query url.
697
+ _query_builder = Configuration.get_base_uri
698
+ _query_builder << '/body/model'
699
+ _query_url = APIHelper.clean_url _query_builder
700
+
701
+ # Prepare headers.
702
+ _headers = {
703
+ 'accept' => 'application/json',
704
+ 'content-type' => 'application/json; charset=utf-8'
705
+ }
706
+
707
+ # Prepare and execute HttpRequest.
708
+ _request = @http_client.post(
709
+ _query_url,
710
+ headers: _headers,
711
+ parameters: model.to_json
712
+ )
713
+ _context = execute_request(_request)
714
+
715
+ # Validate response against endpoint and global error codes.
716
+ return nil if _context.response.status_code == 404
717
+ validate_response(_context)
718
+
719
+ # Return appropriate response type.
720
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
721
+ ServerResponse.from_hash(decoded)
722
+ end
723
+
724
+ # TODO: type endpoint description here
725
+ # @param [List of Employee] models Required parameter: Example:
726
+ # @return ServerResponse response from the API call
727
+ def send_model_array(models)
728
+ # Validate required parameters.
729
+ validate_parameters(
730
+ 'models' => models
731
+ )
732
+ # Prepare query url.
733
+ _query_builder = Configuration.get_base_uri
734
+ _query_builder << '/body/model'
735
+ _query_builder = APIHelper.append_url_with_query_parameters(
736
+ _query_builder,
737
+ {
738
+ 'array' => true
739
+ },
740
+ array_serialization: Configuration.array_serialization
741
+ )
742
+ _query_url = APIHelper.clean_url _query_builder
743
+
744
+ # Prepare headers.
745
+ _headers = {
746
+ 'accept' => 'application/json',
747
+ 'content-type' => 'application/json; charset=utf-8'
748
+ }
749
+
750
+ # Prepare and execute HttpRequest.
751
+ _request = @http_client.post(
752
+ _query_url,
753
+ headers: _headers,
754
+ parameters: models.to_json
755
+ )
756
+ _context = execute_request(_request)
757
+
758
+ # Validate response against endpoint and global error codes.
759
+ return nil if _context.response.status_code == 404
760
+ validate_response(_context)
761
+
762
+ # Return appropriate response type.
763
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
764
+ ServerResponse.from_hash(decoded)
765
+ end
766
+
767
+ # TODO: type endpoint description here
768
+ # @param [Object] dynamic Required parameter: Example:
769
+ # @return ServerResponse response from the API call
770
+ def send_dynamic(dynamic)
771
+ # Validate required parameters.
772
+ validate_parameters(
773
+ 'dynamic' => dynamic
774
+ )
775
+ # Prepare query url.
776
+ _query_builder = Configuration.get_base_uri
777
+ _query_builder << '/body/dynamic'
778
+ _query_url = APIHelper.clean_url _query_builder
779
+
780
+ # Prepare headers.
781
+ _headers = {
782
+ 'accept' => 'application/json',
783
+ 'content-type' => 'application/json; charset=utf-8'
784
+ }
785
+
786
+ # Prepare and execute HttpRequest.
787
+ _request = @http_client.post(
788
+ _query_url,
789
+ headers: _headers,
790
+ parameters: dynamic.to_json
791
+ )
792
+ _context = execute_request(_request)
793
+
794
+ # Validate response against endpoint and global error codes.
795
+ return nil if _context.response.status_code == 404
796
+ validate_response(_context)
797
+
798
+ # Return appropriate response type.
799
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
800
+ ServerResponse.from_hash(decoded)
801
+ end
802
+
803
+ # TODO: type endpoint description here
804
+ # @param [String] value Required parameter: Example:
805
+ # @return ServerResponse response from the API call
806
+ def send_string(value)
807
+ # Validate required parameters.
808
+ validate_parameters(
809
+ 'value' => value
810
+ )
811
+ # Prepare query url.
812
+ _query_builder = Configuration.get_base_uri
813
+ _query_builder << '/body/string'
814
+ _query_url = APIHelper.clean_url _query_builder
815
+
816
+ # Prepare headers.
817
+ _headers = {
818
+ 'accept' => 'application/json',
819
+ 'content-type' => 'text/plain; charset=utf-8'
820
+ }
821
+
822
+ # Prepare and execute HttpRequest.
823
+ _request = @http_client.post(
824
+ _query_url,
825
+ headers: _headers,
826
+ parameters: value
827
+ )
828
+ _context = execute_request(_request)
829
+
830
+ # Validate response against endpoint and global error codes.
831
+ return nil if _context.response.status_code == 404
832
+ validate_response(_context)
833
+
834
+ # Return appropriate response type.
835
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
836
+ ServerResponse.from_hash(decoded)
837
+ end
838
+
839
+ # TODO: type endpoint description here
840
+ # @param [List of Days] days Required parameter: Example:
841
+ # @return ServerResponse response from the API call
842
+ def send_string_enum_array(days)
843
+ # Validate required parameters.
844
+ validate_parameters(
845
+ 'days' => days
846
+ )
847
+ # Prepare query url.
848
+ _query_builder = Configuration.get_base_uri
849
+ _query_builder << '/body/stringenum'
850
+ _query_builder = APIHelper.append_url_with_query_parameters(
851
+ _query_builder,
852
+ {
853
+ 'array' => true
854
+ },
855
+ array_serialization: Configuration.array_serialization
856
+ )
857
+ _query_url = APIHelper.clean_url _query_builder
858
+
859
+ # Prepare headers.
860
+ _headers = {
861
+ 'accept' => 'application/json',
862
+ 'content-type' => 'application/json; charset=utf-8'
863
+ }
864
+
865
+ # Prepare and execute HttpRequest.
866
+ _request = @http_client.post(
867
+ _query_url,
868
+ headers: _headers,
869
+ parameters: days.to_json
870
+ )
871
+ _context = execute_request(_request)
872
+
873
+ # Validate response against endpoint and global error codes.
874
+ return nil if _context.response.status_code == 404
875
+ validate_response(_context)
876
+
877
+ # Return appropriate response type.
878
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
879
+ ServerResponse.from_hash(decoded)
880
+ end
881
+
882
+ # TODO: type endpoint description here
883
+ # @param [List of SuiteCode] suites Required parameter: Example:
884
+ # @return ServerResponse response from the API call
885
+ def send_integer_enum_array(suites)
886
+ # Validate required parameters.
887
+ validate_parameters(
888
+ 'suites' => suites
889
+ )
890
+ # Prepare query url.
891
+ _query_builder = Configuration.get_base_uri
892
+ _query_builder << '/body/integerenum'
893
+ _query_builder = APIHelper.append_url_with_query_parameters(
894
+ _query_builder,
895
+ {
896
+ 'array' => true
897
+ },
898
+ array_serialization: Configuration.array_serialization
899
+ )
900
+ _query_url = APIHelper.clean_url _query_builder
901
+
902
+ # Prepare headers.
903
+ _headers = {
904
+ 'accept' => 'application/json',
905
+ 'content-type' => 'application/json; charset=utf-8'
906
+ }
907
+
908
+ # Prepare and execute HttpRequest.
909
+ _request = @http_client.post(
910
+ _query_url,
911
+ headers: _headers,
912
+ parameters: suites.to_json
913
+ )
914
+ _context = execute_request(_request)
915
+
916
+ # Validate response against endpoint and global error codes.
917
+ return nil if _context.response.status_code == 404
918
+ validate_response(_context)
919
+
920
+ # Return appropriate response type.
921
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
922
+ ServerResponse.from_hash(decoded)
923
+ end
924
+
925
+ # TODO: type endpoint description here
926
+ # @param [Employee] model Required parameter: Example:
927
+ # @return ServerResponse response from the API call
928
+ def update_model(model)
929
+ # Validate required parameters.
930
+ validate_parameters(
931
+ 'model' => model
932
+ )
933
+ # Prepare query url.
934
+ _query_builder = Configuration.get_base_uri
935
+ _query_builder << '/body/updateModel'
936
+ _query_url = APIHelper.clean_url _query_builder
937
+
938
+ # Prepare headers.
939
+ _headers = {
940
+ 'accept' => 'application/json',
941
+ 'content-type' => 'application/json; charset=utf-8'
942
+ }
943
+
944
+ # Prepare and execute HttpRequest.
945
+ _request = @http_client.put(
946
+ _query_url,
947
+ headers: _headers,
948
+ parameters: model.to_json
949
+ )
950
+ _context = execute_request(_request)
951
+
952
+ # Validate response against endpoint and global error codes.
953
+ return nil if _context.response.status_code == 404
954
+ validate_response(_context)
955
+
956
+ # Return appropriate response type.
957
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
958
+ ServerResponse.from_hash(decoded)
959
+ end
960
+
961
+ # TODO: type endpoint description here
962
+ # @param [Employee] model Required parameter: Example:
963
+ # @return ServerResponse response from the API call
964
+ def send_delete_body_with_model(model)
965
+ # Validate required parameters.
966
+ validate_parameters(
967
+ 'model' => model
968
+ )
969
+ # Prepare query url.
970
+ _query_builder = Configuration.get_base_uri
971
+ _query_builder << '/body/deleteBody1'
972
+ _query_url = APIHelper.clean_url _query_builder
973
+
974
+ # Prepare headers.
975
+ _headers = {
976
+ 'accept' => 'application/json',
977
+ 'content-type' => 'application/json; charset=utf-8'
978
+ }
979
+
980
+ # Prepare and execute HttpRequest.
981
+ _request = @http_client.delete(
982
+ _query_url,
983
+ headers: _headers,
984
+ parameters: model.to_json
985
+ )
986
+ _context = execute_request(_request)
987
+
988
+ # Validate response against endpoint and global error codes.
989
+ return nil if _context.response.status_code == 404
990
+ validate_response(_context)
991
+
992
+ # Return appropriate response type.
993
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
994
+ ServerResponse.from_hash(decoded)
995
+ end
996
+
997
+ # TODO: type endpoint description here
998
+ # @param [List of Employee] models Required parameter: Example:
999
+ # @return ServerResponse response from the API call
1000
+ def send_delete_body_with_model_array(models)
1001
+ # Validate required parameters.
1002
+ validate_parameters(
1003
+ 'models' => models
1004
+ )
1005
+ # Prepare query url.
1006
+ _query_builder = Configuration.get_base_uri
1007
+ _query_builder << '/body/deleteBody1'
1008
+ _query_builder = APIHelper.append_url_with_query_parameters(
1009
+ _query_builder,
1010
+ {
1011
+ 'array' => true
1012
+ },
1013
+ array_serialization: Configuration.array_serialization
1014
+ )
1015
+ _query_url = APIHelper.clean_url _query_builder
1016
+
1017
+ # Prepare headers.
1018
+ _headers = {
1019
+ 'accept' => 'application/json',
1020
+ 'content-type' => 'application/json; charset=utf-8'
1021
+ }
1022
+
1023
+ # Prepare and execute HttpRequest.
1024
+ _request = @http_client.delete(
1025
+ _query_url,
1026
+ headers: _headers,
1027
+ parameters: models.to_json
1028
+ )
1029
+ _context = execute_request(_request)
1030
+
1031
+ # Validate response against endpoint and global error codes.
1032
+ return nil if _context.response.status_code == 404
1033
+ validate_response(_context)
1034
+
1035
+ # Return appropriate response type.
1036
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1037
+ ServerResponse.from_hash(decoded)
1038
+ end
1039
+
1040
+ # TODO: type endpoint description here
1041
+ # @param [List of Employee] models Required parameter: Example:
1042
+ # @return ServerResponse response from the API call
1043
+ def update_model_array(models)
1044
+ # Validate required parameters.
1045
+ validate_parameters(
1046
+ 'models' => models
1047
+ )
1048
+ # Prepare query url.
1049
+ _query_builder = Configuration.get_base_uri
1050
+ _query_builder << '/body/updateModel'
1051
+ _query_builder = APIHelper.append_url_with_query_parameters(
1052
+ _query_builder,
1053
+ {
1054
+ 'array' => true
1055
+ },
1056
+ array_serialization: Configuration.array_serialization
1057
+ )
1058
+ _query_url = APIHelper.clean_url _query_builder
1059
+
1060
+ # Prepare headers.
1061
+ _headers = {
1062
+ 'accept' => 'application/json',
1063
+ 'content-type' => 'application/json; charset=utf-8'
1064
+ }
1065
+
1066
+ # Prepare and execute HttpRequest.
1067
+ _request = @http_client.put(
1068
+ _query_url,
1069
+ headers: _headers,
1070
+ parameters: models.to_json
1071
+ )
1072
+ _context = execute_request(_request)
1073
+
1074
+ # Validate response against endpoint and global error codes.
1075
+ return nil if _context.response.status_code == 404
1076
+ validate_response(_context)
1077
+
1078
+ # Return appropriate response type.
1079
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1080
+ ServerResponse.from_hash(decoded)
1081
+ end
1082
+
1083
+ # TODO: type endpoint description here
1084
+ # @param [String] value Required parameter: Example:
1085
+ # @return ServerResponse response from the API call
1086
+ def update_string_1(value)
1087
+ # Validate required parameters.
1088
+ validate_parameters(
1089
+ 'value' => value
1090
+ )
1091
+ # Prepare query url.
1092
+ _query_builder = Configuration.get_base_uri
1093
+ _query_builder << '/body/updateString'
1094
+ _query_url = APIHelper.clean_url _query_builder
1095
+
1096
+ # Prepare headers.
1097
+ _headers = {
1098
+ 'accept' => 'application/json',
1099
+ 'content-type' => 'text/plain; charset=utf-8'
1100
+ }
1101
+
1102
+ # Prepare and execute HttpRequest.
1103
+ _request = @http_client.put(
1104
+ _query_url,
1105
+ headers: _headers,
1106
+ parameters: value
1107
+ )
1108
+ _context = execute_request(_request)
1109
+
1110
+ # Validate response against endpoint and global error codes.
1111
+ return nil if _context.response.status_code == 404
1112
+ validate_response(_context)
1113
+
1114
+ # Return appropriate response type.
1115
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1116
+ ServerResponse.from_hash(decoded)
1117
+ end
1118
+
1119
+ # TODO: type endpoint description here
1120
+ # @param [List of String] strings Required parameter: Example:
1121
+ # @return ServerResponse response from the API call
1122
+ def update_string_array(strings)
1123
+ # Validate required parameters.
1124
+ validate_parameters(
1125
+ 'strings' => strings
1126
+ )
1127
+ # Prepare query url.
1128
+ _query_builder = Configuration.get_base_uri
1129
+ _query_builder << '/body/updateString'
1130
+ _query_builder = APIHelper.append_url_with_query_parameters(
1131
+ _query_builder,
1132
+ {
1133
+ 'array' => true
1134
+ },
1135
+ array_serialization: Configuration.array_serialization
1136
+ )
1137
+ _query_url = APIHelper.clean_url _query_builder
1138
+
1139
+ # Prepare headers.
1140
+ _headers = {
1141
+ 'accept' => 'application/json',
1142
+ 'content-type' => 'application/json; charset=utf-8'
1143
+ }
1144
+
1145
+ # Prepare and execute HttpRequest.
1146
+ _request = @http_client.put(
1147
+ _query_url,
1148
+ headers: _headers,
1149
+ parameters: strings.to_json
1150
+ )
1151
+ _context = execute_request(_request)
1152
+
1153
+ # Validate response against endpoint and global error codes.
1154
+ return nil if _context.response.status_code == 404
1155
+ validate_response(_context)
1156
+
1157
+ # Return appropriate response type.
1158
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1159
+ ServerResponse.from_hash(decoded)
1160
+ end
1161
+
1162
+ # TODO: type endpoint description here
1163
+ # @param [TestNstringEncoding] body Required parameter: Example:
1164
+ # @return ServerResponse response from the API call
1165
+ def send_string_with_new_line(body)
1166
+ # Validate required parameters.
1167
+ validate_parameters(
1168
+ 'body' => body
1169
+ )
1170
+ # Prepare query url.
1171
+ _query_builder = Configuration.get_base_uri
1172
+ _query_builder << '/body/stringEncoding'
1173
+ _query_url = APIHelper.clean_url _query_builder
1174
+
1175
+ # Prepare headers.
1176
+ _headers = {
1177
+ 'accept' => 'application/json',
1178
+ 'content-type' => 'application/json; charset=utf-8'
1179
+ }
1180
+
1181
+ # Prepare and execute HttpRequest.
1182
+ _request = @http_client.post(
1183
+ _query_url,
1184
+ headers: _headers,
1185
+ parameters: body.to_json
1186
+ )
1187
+ _context = execute_request(_request)
1188
+
1189
+ # Validate response against endpoint and global error codes.
1190
+ return nil if _context.response.status_code == 404
1191
+ validate_response(_context)
1192
+
1193
+ # Return appropriate response type.
1194
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1195
+ ServerResponse.from_hash(decoded)
1196
+ end
1197
+
1198
+ # TODO: type endpoint description here
1199
+ # @param [TestRstringEncoding] body Required parameter: Example:
1200
+ # @return ServerResponse response from the API call
1201
+ def send_string_with_r(body)
1202
+ # Validate required parameters.
1203
+ validate_parameters(
1204
+ 'body' => body
1205
+ )
1206
+ # Prepare query url.
1207
+ _query_builder = Configuration.get_base_uri
1208
+ _query_builder << '/body/stringEncoding'
1209
+ _query_url = APIHelper.clean_url _query_builder
1210
+
1211
+ # Prepare headers.
1212
+ _headers = {
1213
+ 'accept' => 'application/json',
1214
+ 'content-type' => 'application/json; charset=utf-8'
1215
+ }
1216
+
1217
+ # Prepare and execute HttpRequest.
1218
+ _request = @http_client.post(
1219
+ _query_url,
1220
+ headers: _headers,
1221
+ parameters: body.to_json
1222
+ )
1223
+ _context = execute_request(_request)
1224
+
1225
+ # Validate response against endpoint and global error codes.
1226
+ return nil if _context.response.status_code == 404
1227
+ validate_response(_context)
1228
+
1229
+ # Return appropriate response type.
1230
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1231
+ ServerResponse.from_hash(decoded)
1232
+ end
1233
+
1234
+ # TODO: type endpoint description here
1235
+ # @param [TestRNstringEncoding] body Required parameter: Example:
1236
+ # @return ServerResponse response from the API call
1237
+ def send_string_in_body_with_r_n(body)
1238
+ # Validate required parameters.
1239
+ validate_parameters(
1240
+ 'body' => body
1241
+ )
1242
+ # Prepare query url.
1243
+ _query_builder = Configuration.get_base_uri
1244
+ _query_builder << '/body/stringEncoding'
1245
+ _query_url = APIHelper.clean_url _query_builder
1246
+
1247
+ # Prepare headers.
1248
+ _headers = {
1249
+ 'accept' => 'application/json',
1250
+ 'content-type' => 'application/json; charset=utf-8'
1251
+ }
1252
+
1253
+ # Prepare and execute HttpRequest.
1254
+ _request = @http_client.post(
1255
+ _query_url,
1256
+ headers: _headers,
1257
+ parameters: body.to_json
1258
+ )
1259
+ _context = execute_request(_request)
1260
+
1261
+ # Validate response against endpoint and global error codes.
1262
+ return nil if _context.response.status_code == 404
1263
+ validate_response(_context)
1264
+
1265
+ # Return appropriate response type.
1266
+ decoded = APIHelper.json_deserialize(_context.response.raw_body)
1267
+ ServerResponse.from_hash(decoded)
1268
+ end
1269
+ end
1270
+ end