hjhjhjnew 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +55 -0
- data/lib/tester.rb +56 -0
- data/lib/tester/api_helper.rb +261 -0
- data/lib/tester/configuration.rb +66 -0
- data/lib/tester/controllers/base_controller.rb +59 -0
- data/lib/tester/controllers/body_params_controller.rb +1270 -0
- data/lib/tester/controllers/echo_controller.rb +134 -0
- data/lib/tester/controllers/error_codes_controller.rb +179 -0
- data/lib/tester/controllers/form_params_controller.rb +1391 -0
- data/lib/tester/controllers/header_controller.rb +63 -0
- data/lib/tester/controllers/query_param_controller.rb +779 -0
- data/lib/tester/controllers/response_types_controller.rb +717 -0
- data/lib/tester/controllers/template_params_controller.rb +93 -0
- data/lib/tester/exceptions/api_exception.rb +18 -0
- data/lib/tester/exceptions/global_test_exception.rb +32 -0
- data/lib/tester/exceptions/local_test_exception.rb +30 -0
- data/lib/tester/exceptions/nested_model_exception.rb +37 -0
- data/lib/tester/http/faraday_client.rb +55 -0
- data/lib/tester/http/http_call_back.rb +22 -0
- data/lib/tester/http/http_client.rb +92 -0
- data/lib/tester/http/http_context.rb +18 -0
- data/lib/tester/http/http_method_enum.rb +11 -0
- data/lib/tester/http/http_request.rb +48 -0
- data/lib/tester/http/http_response.rb +21 -0
- data/lib/tester/models/additional_model_parameters.rb +70 -0
- data/lib/tester/models/base_model.rb +52 -0
- data/lib/tester/models/boss.rb +129 -0
- data/lib/tester/models/days.rb +30 -0
- data/lib/tester/models/delete_body.rb +52 -0
- data/lib/tester/models/echo_response.rb +88 -0
- data/lib/tester/models/employee.rb +155 -0
- data/lib/tester/models/job.rb +43 -0
- data/lib/tester/models/person.rb +113 -0
- data/lib/tester/models/query_parameter.rb +43 -0
- data/lib/tester/models/server_response.rb +61 -0
- data/lib/tester/models/suite_code.rb +21 -0
- data/lib/tester/models/test_nstring_encoding.rb +52 -0
- data/lib/tester/models/test_r_nstring_encoding.rb +52 -0
- data/lib/tester/models/test_rstring_encoding.rb +52 -0
- data/lib/tester/models/validate.rb +61 -0
- data/lib/tester/tester_client.rb +61 -0
- data/test/controllers/controller_test_base.rb +33 -0
- data/test/controllers/test_body_params_controller.rb +1210 -0
- data/test/controllers/test_echo_controller.rb +29 -0
- data/test/controllers/test_error_codes_controller.rb +47 -0
- data/test/controllers/test_form_params_controller.rb +1099 -0
- data/test/controllers/test_header_controller.rb +30 -0
- data/test/controllers/test_query_param_controller.rb +345 -0
- data/test/controllers/test_response_types_controller.rb +429 -0
- data/test/controllers/test_template_params_controller.rb +47 -0
- data/test/http_response_catcher.rb +16 -0
- data/test/test_helper.rb +91 -0
- metadata +178 -0
@@ -0,0 +1,717 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
require 'date'
|
5
|
+
|
6
|
+
module Tester
|
7
|
+
# ResponseTypesController
|
8
|
+
class ResponseTypesController < BaseController
|
9
|
+
@instance = ResponseTypesController.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def instance
|
16
|
+
self.class.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# TODO: type endpoint description here
|
20
|
+
# @return List of Date response from the API call
|
21
|
+
def get_date_array
|
22
|
+
# Prepare query url.
|
23
|
+
_query_builder = Configuration.get_base_uri
|
24
|
+
_query_builder << '/response/date'
|
25
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
26
|
+
_query_builder,
|
27
|
+
{
|
28
|
+
'array' => true
|
29
|
+
},
|
30
|
+
array_serialization: Configuration.array_serialization
|
31
|
+
)
|
32
|
+
_query_url = APIHelper.clean_url _query_builder
|
33
|
+
|
34
|
+
# Prepare headers.
|
35
|
+
_headers = {
|
36
|
+
'accept' => 'application/json'
|
37
|
+
}
|
38
|
+
|
39
|
+
# Prepare and execute HttpRequest.
|
40
|
+
_request = @http_client.get(
|
41
|
+
_query_url,
|
42
|
+
headers: _headers
|
43
|
+
)
|
44
|
+
_context = execute_request(_request)
|
45
|
+
|
46
|
+
# Validate response against endpoint and global error codes.
|
47
|
+
return nil if _context.response.status_code == 404
|
48
|
+
validate_response(_context)
|
49
|
+
|
50
|
+
# Return appropriate response type.
|
51
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
52
|
+
decoded.map { |element| Date.iso8601(element) }
|
53
|
+
end
|
54
|
+
|
55
|
+
# TODO: type endpoint description here
|
56
|
+
# @return Date response from the API call
|
57
|
+
def get_date
|
58
|
+
# Prepare query url.
|
59
|
+
_query_builder = Configuration.get_base_uri
|
60
|
+
_query_builder << '/response/date'
|
61
|
+
_query_url = APIHelper.clean_url _query_builder
|
62
|
+
|
63
|
+
# Prepare and execute HttpRequest.
|
64
|
+
_request = @http_client.get(
|
65
|
+
_query_url
|
66
|
+
)
|
67
|
+
_context = execute_request(_request)
|
68
|
+
|
69
|
+
# Validate response against endpoint and global error codes.
|
70
|
+
return nil if _context.response.status_code == 404
|
71
|
+
validate_response(_context)
|
72
|
+
|
73
|
+
# Return appropriate response type.
|
74
|
+
Date.iso8601(_context.response.raw_body)
|
75
|
+
end
|
76
|
+
|
77
|
+
# TODO: type endpoint description here
|
78
|
+
# @return Long response from the API call
|
79
|
+
def get_long
|
80
|
+
# Prepare query url.
|
81
|
+
_query_builder = Configuration.get_base_uri(
|
82
|
+
Configuration::Server::DEFAULT
|
83
|
+
)
|
84
|
+
_query_builder << '/response/long'
|
85
|
+
_query_url = APIHelper.clean_url _query_builder
|
86
|
+
|
87
|
+
# Prepare and execute HttpRequest.
|
88
|
+
_request = @http_client.get(
|
89
|
+
_query_url
|
90
|
+
)
|
91
|
+
_context = execute_request(_request)
|
92
|
+
|
93
|
+
# Validate response against endpoint and global error codes.
|
94
|
+
return nil if _context.response.status_code == 404
|
95
|
+
validate_response(_context)
|
96
|
+
|
97
|
+
# Return appropriate response type.
|
98
|
+
_context.response.raw_body.to_i
|
99
|
+
end
|
100
|
+
|
101
|
+
# TODO: type endpoint description here
|
102
|
+
# @return Person response from the API call
|
103
|
+
def get_model
|
104
|
+
# Prepare query url.
|
105
|
+
_query_builder = Configuration.get_base_uri
|
106
|
+
_query_builder << '/response/model'
|
107
|
+
_query_url = APIHelper.clean_url _query_builder
|
108
|
+
|
109
|
+
# Prepare headers.
|
110
|
+
_headers = {
|
111
|
+
'accept' => 'application/json'
|
112
|
+
}
|
113
|
+
|
114
|
+
# Prepare and execute HttpRequest.
|
115
|
+
_request = @http_client.get(
|
116
|
+
_query_url,
|
117
|
+
headers: _headers
|
118
|
+
)
|
119
|
+
_context = execute_request(_request)
|
120
|
+
|
121
|
+
# Validate response against endpoint and global error codes.
|
122
|
+
return nil if _context.response.status_code == 404
|
123
|
+
validate_response(_context)
|
124
|
+
|
125
|
+
# Return appropriate response type.
|
126
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
127
|
+
Person.from_hash(decoded)
|
128
|
+
end
|
129
|
+
|
130
|
+
# TODO: type endpoint description here
|
131
|
+
# @return List of Days response from the API call
|
132
|
+
def get_string_enum_array
|
133
|
+
# Prepare query url.
|
134
|
+
_query_builder = Configuration.get_base_uri
|
135
|
+
_query_builder << '/response/enum'
|
136
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
137
|
+
_query_builder,
|
138
|
+
{
|
139
|
+
'array' => true,
|
140
|
+
'type' => 'string'
|
141
|
+
},
|
142
|
+
array_serialization: Configuration.array_serialization
|
143
|
+
)
|
144
|
+
_query_url = APIHelper.clean_url _query_builder
|
145
|
+
|
146
|
+
# Prepare headers.
|
147
|
+
_headers = {
|
148
|
+
'accept' => 'application/json'
|
149
|
+
}
|
150
|
+
|
151
|
+
# Prepare and execute HttpRequest.
|
152
|
+
_request = @http_client.get(
|
153
|
+
_query_url,
|
154
|
+
headers: _headers
|
155
|
+
)
|
156
|
+
_context = execute_request(_request)
|
157
|
+
|
158
|
+
# Validate response against endpoint and global error codes.
|
159
|
+
return nil if _context.response.status_code == 404
|
160
|
+
validate_response(_context)
|
161
|
+
|
162
|
+
# Return appropriate response type.
|
163
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
164
|
+
decoded
|
165
|
+
end
|
166
|
+
|
167
|
+
# TODO: type endpoint description here
|
168
|
+
# @return Days response from the API call
|
169
|
+
def get_string_enum
|
170
|
+
# Prepare query url.
|
171
|
+
_query_builder = Configuration.get_base_uri
|
172
|
+
_query_builder << '/response/enum'
|
173
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
174
|
+
_query_builder,
|
175
|
+
{
|
176
|
+
'type' => 'string'
|
177
|
+
},
|
178
|
+
array_serialization: Configuration.array_serialization
|
179
|
+
)
|
180
|
+
_query_url = APIHelper.clean_url _query_builder
|
181
|
+
|
182
|
+
# Prepare and execute HttpRequest.
|
183
|
+
_request = @http_client.get(
|
184
|
+
_query_url
|
185
|
+
)
|
186
|
+
_context = execute_request(_request)
|
187
|
+
|
188
|
+
# Validate response against endpoint and global error codes.
|
189
|
+
return nil if _context.response.status_code == 404
|
190
|
+
validate_response(_context)
|
191
|
+
|
192
|
+
# Return appropriate response type.
|
193
|
+
_context.response.raw_body
|
194
|
+
end
|
195
|
+
|
196
|
+
# TODO: type endpoint description here
|
197
|
+
# @return List of Person response from the API call
|
198
|
+
def get_model_array
|
199
|
+
# Prepare query url.
|
200
|
+
_query_builder = Configuration.get_base_uri
|
201
|
+
_query_builder << '/response/model'
|
202
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
203
|
+
_query_builder,
|
204
|
+
{
|
205
|
+
'array' => true
|
206
|
+
},
|
207
|
+
array_serialization: Configuration.array_serialization
|
208
|
+
)
|
209
|
+
_query_url = APIHelper.clean_url _query_builder
|
210
|
+
|
211
|
+
# Prepare headers.
|
212
|
+
_headers = {
|
213
|
+
'accept' => 'application/json'
|
214
|
+
}
|
215
|
+
|
216
|
+
# Prepare and execute HttpRequest.
|
217
|
+
_request = @http_client.get(
|
218
|
+
_query_url,
|
219
|
+
headers: _headers
|
220
|
+
)
|
221
|
+
_context = execute_request(_request)
|
222
|
+
|
223
|
+
# Validate response against endpoint and global error codes.
|
224
|
+
return nil if _context.response.status_code == 404
|
225
|
+
validate_response(_context)
|
226
|
+
|
227
|
+
# Return appropriate response type.
|
228
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
229
|
+
decoded.map { |element| Person.from_hash(element) }
|
230
|
+
end
|
231
|
+
|
232
|
+
# TODO: type endpoint description here
|
233
|
+
# @return SuiteCode response from the API call
|
234
|
+
def get_int_enum
|
235
|
+
# Prepare query url.
|
236
|
+
_query_builder = Configuration.get_base_uri
|
237
|
+
_query_builder << '/response/enum'
|
238
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
239
|
+
_query_builder,
|
240
|
+
{
|
241
|
+
'type' => 'int'
|
242
|
+
},
|
243
|
+
array_serialization: Configuration.array_serialization
|
244
|
+
)
|
245
|
+
_query_url = APIHelper.clean_url _query_builder
|
246
|
+
|
247
|
+
# Prepare and execute HttpRequest.
|
248
|
+
_request = @http_client.get(
|
249
|
+
_query_url
|
250
|
+
)
|
251
|
+
_context = execute_request(_request)
|
252
|
+
|
253
|
+
# Validate response against endpoint and global error codes.
|
254
|
+
return nil if _context.response.status_code == 404
|
255
|
+
validate_response(_context)
|
256
|
+
|
257
|
+
# Return appropriate response type.
|
258
|
+
_context.response.raw_body.to_i
|
259
|
+
end
|
260
|
+
|
261
|
+
# TODO: type endpoint description here
|
262
|
+
# @return List of SuiteCode response from the API call
|
263
|
+
def get_int_enum_array
|
264
|
+
# Prepare query url.
|
265
|
+
_query_builder = Configuration.get_base_uri
|
266
|
+
_query_builder << '/response/enum'
|
267
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
268
|
+
_query_builder,
|
269
|
+
{
|
270
|
+
'array' => true,
|
271
|
+
'type' => 'int'
|
272
|
+
},
|
273
|
+
array_serialization: Configuration.array_serialization
|
274
|
+
)
|
275
|
+
_query_url = APIHelper.clean_url _query_builder
|
276
|
+
|
277
|
+
# Prepare headers.
|
278
|
+
_headers = {
|
279
|
+
'accept' => 'application/json'
|
280
|
+
}
|
281
|
+
|
282
|
+
# Prepare and execute HttpRequest.
|
283
|
+
_request = @http_client.get(
|
284
|
+
_query_url,
|
285
|
+
headers: _headers
|
286
|
+
)
|
287
|
+
_context = execute_request(_request)
|
288
|
+
|
289
|
+
# Validate response against endpoint and global error codes.
|
290
|
+
return nil if _context.response.status_code == 404
|
291
|
+
validate_response(_context)
|
292
|
+
|
293
|
+
# Return appropriate response type.
|
294
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
295
|
+
decoded
|
296
|
+
end
|
297
|
+
|
298
|
+
# TODO: type endpoint description here
|
299
|
+
# @return Float response from the API call
|
300
|
+
def get_precision
|
301
|
+
# Prepare query url.
|
302
|
+
_query_builder = Configuration.get_base_uri
|
303
|
+
_query_builder << '/response/precision'
|
304
|
+
_query_url = APIHelper.clean_url _query_builder
|
305
|
+
|
306
|
+
# Prepare and execute HttpRequest.
|
307
|
+
_request = @http_client.get(
|
308
|
+
_query_url
|
309
|
+
)
|
310
|
+
_context = execute_request(_request)
|
311
|
+
|
312
|
+
# Validate response against endpoint and global error codes.
|
313
|
+
return nil if _context.response.status_code == 404
|
314
|
+
validate_response(_context)
|
315
|
+
|
316
|
+
# Return appropriate response type.
|
317
|
+
_context.response.raw_body.to_f
|
318
|
+
end
|
319
|
+
|
320
|
+
# gets a binary object
|
321
|
+
# @return Binary response from the API call
|
322
|
+
def get_binary
|
323
|
+
# Prepare query url.
|
324
|
+
_query_builder = Configuration.get_base_uri
|
325
|
+
_query_builder << '/response/binary'
|
326
|
+
_query_url = APIHelper.clean_url _query_builder
|
327
|
+
|
328
|
+
# Prepare and execute HttpRequest.
|
329
|
+
_request = @http_client.get(
|
330
|
+
_query_url
|
331
|
+
)
|
332
|
+
_context = execute_request(_request, binary: true)
|
333
|
+
|
334
|
+
# Validate response against endpoint and global error codes.
|
335
|
+
return nil if _context.response.status_code == 404
|
336
|
+
validate_response(_context)
|
337
|
+
|
338
|
+
# Return appropriate response type.
|
339
|
+
_context.response.raw_body
|
340
|
+
end
|
341
|
+
|
342
|
+
# Gets a integer response
|
343
|
+
# @return Integer response from the API call
|
344
|
+
def get_integer
|
345
|
+
# Prepare query url.
|
346
|
+
_query_builder = Configuration.get_base_uri
|
347
|
+
_query_builder << '/response/integer'
|
348
|
+
_query_url = APIHelper.clean_url _query_builder
|
349
|
+
|
350
|
+
# Prepare and execute HttpRequest.
|
351
|
+
_request = @http_client.get(
|
352
|
+
_query_url
|
353
|
+
)
|
354
|
+
_context = execute_request(_request)
|
355
|
+
|
356
|
+
# Validate response against endpoint and global error codes.
|
357
|
+
return nil if _context.response.status_code == 404
|
358
|
+
validate_response(_context)
|
359
|
+
|
360
|
+
# Return appropriate response type.
|
361
|
+
_context.response.raw_body.to_i
|
362
|
+
end
|
363
|
+
|
364
|
+
# Get an array of integers.
|
365
|
+
# @return List of Integer response from the API call
|
366
|
+
def get_integer_array
|
367
|
+
# Prepare query url.
|
368
|
+
_query_builder = Configuration.get_base_uri
|
369
|
+
_query_builder << '/response/integer'
|
370
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
371
|
+
_query_builder,
|
372
|
+
{
|
373
|
+
'array' => true
|
374
|
+
},
|
375
|
+
array_serialization: Configuration.array_serialization
|
376
|
+
)
|
377
|
+
_query_url = APIHelper.clean_url _query_builder
|
378
|
+
|
379
|
+
# Prepare headers.
|
380
|
+
_headers = {
|
381
|
+
'accept' => 'application/json'
|
382
|
+
}
|
383
|
+
|
384
|
+
# Prepare and execute HttpRequest.
|
385
|
+
_request = @http_client.get(
|
386
|
+
_query_url,
|
387
|
+
headers: _headers
|
388
|
+
)
|
389
|
+
_context = execute_request(_request)
|
390
|
+
|
391
|
+
# Validate response against endpoint and global error codes.
|
392
|
+
return nil if _context.response.status_code == 404
|
393
|
+
validate_response(_context)
|
394
|
+
|
395
|
+
# Return appropriate response type.
|
396
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
397
|
+
decoded
|
398
|
+
end
|
399
|
+
|
400
|
+
# TODO: type endpoint description here
|
401
|
+
# @return Mixed response from the API call
|
402
|
+
def get_dynamic
|
403
|
+
# Prepare query url.
|
404
|
+
_query_builder = Configuration.get_base_uri
|
405
|
+
_query_builder << '/response/dynamic'
|
406
|
+
_query_url = APIHelper.clean_url _query_builder
|
407
|
+
|
408
|
+
# Prepare headers.
|
409
|
+
_headers = {
|
410
|
+
'accept' => 'application/json'
|
411
|
+
}
|
412
|
+
|
413
|
+
# Prepare and execute HttpRequest.
|
414
|
+
_request = @http_client.get(
|
415
|
+
_query_url,
|
416
|
+
headers: _headers
|
417
|
+
)
|
418
|
+
_context = execute_request(_request)
|
419
|
+
|
420
|
+
# Validate response against endpoint and global error codes.
|
421
|
+
return nil if _context.response.status_code == 404
|
422
|
+
validate_response(_context)
|
423
|
+
|
424
|
+
# Return appropriate response type.
|
425
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body) unless
|
426
|
+
_context.response.raw_body.nil? ||
|
427
|
+
_context.response.raw_body.to_s.strip.empty?
|
428
|
+
decoded
|
429
|
+
end
|
430
|
+
|
431
|
+
# TODO: type endpoint description here
|
432
|
+
# @return Mixed response from the API call
|
433
|
+
def get_dynamic_array
|
434
|
+
# Prepare query url.
|
435
|
+
_query_builder = Configuration.get_base_uri
|
436
|
+
_query_builder << '/response/dynamic'
|
437
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
438
|
+
_query_builder,
|
439
|
+
{
|
440
|
+
'array' => true
|
441
|
+
},
|
442
|
+
array_serialization: Configuration.array_serialization
|
443
|
+
)
|
444
|
+
_query_url = APIHelper.clean_url _query_builder
|
445
|
+
|
446
|
+
# Prepare headers.
|
447
|
+
_headers = {
|
448
|
+
'accept' => 'application/json'
|
449
|
+
}
|
450
|
+
|
451
|
+
# Prepare and execute HttpRequest.
|
452
|
+
_request = @http_client.get(
|
453
|
+
_query_url,
|
454
|
+
headers: _headers
|
455
|
+
)
|
456
|
+
_context = execute_request(_request)
|
457
|
+
|
458
|
+
# Validate response against endpoint and global error codes.
|
459
|
+
return nil if _context.response.status_code == 404
|
460
|
+
validate_response(_context)
|
461
|
+
|
462
|
+
# Return appropriate response type.
|
463
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body) unless
|
464
|
+
_context.response.raw_body.nil? ||
|
465
|
+
_context.response.raw_body.to_s.strip.empty?
|
466
|
+
decoded
|
467
|
+
end
|
468
|
+
|
469
|
+
# TODO: type endpoint description here
|
470
|
+
# @return DateTime response from the API call
|
471
|
+
def get_3339_datetime
|
472
|
+
# Prepare query url.
|
473
|
+
_query_builder = Configuration.get_base_uri
|
474
|
+
_query_builder << '/response/3339datetime'
|
475
|
+
_query_url = APIHelper.clean_url _query_builder
|
476
|
+
|
477
|
+
# Prepare and execute HttpRequest.
|
478
|
+
_request = @http_client.get(
|
479
|
+
_query_url
|
480
|
+
)
|
481
|
+
_context = execute_request(_request)
|
482
|
+
|
483
|
+
# Validate response against endpoint and global error codes.
|
484
|
+
return nil if _context.response.status_code == 404
|
485
|
+
validate_response(_context)
|
486
|
+
|
487
|
+
# Return appropriate response type.
|
488
|
+
DateTime.rfc3339(_context.response.raw_body)
|
489
|
+
end
|
490
|
+
|
491
|
+
# TODO: type endpoint description here
|
492
|
+
# @return List of DateTime response from the API call
|
493
|
+
def get_3339_datetime_array
|
494
|
+
# Prepare query url.
|
495
|
+
_query_builder = Configuration.get_base_uri
|
496
|
+
_query_builder << '/response/3339datetime'
|
497
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
498
|
+
_query_builder,
|
499
|
+
{
|
500
|
+
'array' => true
|
501
|
+
},
|
502
|
+
array_serialization: Configuration.array_serialization
|
503
|
+
)
|
504
|
+
_query_url = APIHelper.clean_url _query_builder
|
505
|
+
|
506
|
+
# Prepare headers.
|
507
|
+
_headers = {
|
508
|
+
'accept' => 'application/json'
|
509
|
+
}
|
510
|
+
|
511
|
+
# Prepare and execute HttpRequest.
|
512
|
+
_request = @http_client.get(
|
513
|
+
_query_url,
|
514
|
+
headers: _headers
|
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
|
+
decoded.map { |element| DateTime.rfc3339(element) }
|
525
|
+
end
|
526
|
+
|
527
|
+
# TODO: type endpoint description here
|
528
|
+
# @return Boolean response from the API call
|
529
|
+
def get_boolean
|
530
|
+
# Prepare query url.
|
531
|
+
_query_builder = Configuration.get_base_uri
|
532
|
+
_query_builder << '/response/boolean'
|
533
|
+
_query_url = APIHelper.clean_url _query_builder
|
534
|
+
|
535
|
+
# Prepare and execute HttpRequest.
|
536
|
+
_request = @http_client.get(
|
537
|
+
_query_url
|
538
|
+
)
|
539
|
+
_context = execute_request(_request)
|
540
|
+
|
541
|
+
# Validate response against endpoint and global error codes.
|
542
|
+
return nil if _context.response.status_code == 404
|
543
|
+
validate_response(_context)
|
544
|
+
|
545
|
+
# Return appropriate response type.
|
546
|
+
_context.response.raw_body.to_bool
|
547
|
+
end
|
548
|
+
|
549
|
+
# TODO: type endpoint description here
|
550
|
+
# @return List of Boolean response from the API call
|
551
|
+
def get_boolean_array
|
552
|
+
# Prepare query url.
|
553
|
+
_query_builder = Configuration.get_base_uri
|
554
|
+
_query_builder << '/response/boolean'
|
555
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
556
|
+
_query_builder,
|
557
|
+
{
|
558
|
+
'array' => true
|
559
|
+
},
|
560
|
+
array_serialization: Configuration.array_serialization
|
561
|
+
)
|
562
|
+
_query_url = APIHelper.clean_url _query_builder
|
563
|
+
|
564
|
+
# Prepare headers.
|
565
|
+
_headers = {
|
566
|
+
'accept' => 'application/json'
|
567
|
+
}
|
568
|
+
|
569
|
+
# Prepare and execute HttpRequest.
|
570
|
+
_request = @http_client.get(
|
571
|
+
_query_url,
|
572
|
+
headers: _headers
|
573
|
+
)
|
574
|
+
_context = execute_request(_request)
|
575
|
+
|
576
|
+
# Validate response against endpoint and global error codes.
|
577
|
+
return nil if _context.response.status_code == 404
|
578
|
+
validate_response(_context)
|
579
|
+
|
580
|
+
# Return appropriate response type.
|
581
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
582
|
+
decoded
|
583
|
+
end
|
584
|
+
|
585
|
+
# TODO: type endpoint description here
|
586
|
+
# @return void response from the API call
|
587
|
+
def get_headers
|
588
|
+
# Prepare query url.
|
589
|
+
_query_builder = Configuration.get_base_uri
|
590
|
+
_query_builder << '/response/headers'
|
591
|
+
_query_url = APIHelper.clean_url _query_builder
|
592
|
+
|
593
|
+
# Prepare and execute HttpRequest.
|
594
|
+
_request = @http_client.get(
|
595
|
+
_query_url
|
596
|
+
)
|
597
|
+
_context = execute_request(_request)
|
598
|
+
validate_response(_context)
|
599
|
+
end
|
600
|
+
|
601
|
+
# TODO: type endpoint description here
|
602
|
+
# @return DateTime response from the API call
|
603
|
+
def get_1123_date_time
|
604
|
+
# Prepare query url.
|
605
|
+
_query_builder = Configuration.get_base_uri
|
606
|
+
_query_builder << '/response/1123datetime'
|
607
|
+
_query_url = APIHelper.clean_url _query_builder
|
608
|
+
|
609
|
+
# Prepare and execute HttpRequest.
|
610
|
+
_request = @http_client.get(
|
611
|
+
_query_url
|
612
|
+
)
|
613
|
+
_context = execute_request(_request)
|
614
|
+
|
615
|
+
# Validate response against endpoint and global error codes.
|
616
|
+
return nil if _context.response.status_code == 404
|
617
|
+
validate_response(_context)
|
618
|
+
|
619
|
+
# Return appropriate response type.
|
620
|
+
DateTime.httpdate(_context.response.raw_body)
|
621
|
+
end
|
622
|
+
|
623
|
+
# TODO: type endpoint description here
|
624
|
+
# @return DateTime response from the API call
|
625
|
+
def get_unix_date_time
|
626
|
+
# Prepare query url.
|
627
|
+
_query_builder = Configuration.get_base_uri
|
628
|
+
_query_builder << '/response/unixdatetime'
|
629
|
+
_query_url = APIHelper.clean_url _query_builder
|
630
|
+
|
631
|
+
# Prepare and execute HttpRequest.
|
632
|
+
_request = @http_client.get(
|
633
|
+
_query_url
|
634
|
+
)
|
635
|
+
_context = execute_request(_request)
|
636
|
+
|
637
|
+
# Validate response against endpoint and global error codes.
|
638
|
+
return nil if _context.response.status_code == 404
|
639
|
+
validate_response(_context)
|
640
|
+
|
641
|
+
# Return appropriate response type.
|
642
|
+
Time.at(_context.response.raw_body.to_i).utc.to_datetime
|
643
|
+
end
|
644
|
+
|
645
|
+
# TODO: type endpoint description here
|
646
|
+
# @return List of DateTime response from the API call
|
647
|
+
def get_1123_date_time_array
|
648
|
+
# Prepare query url.
|
649
|
+
_query_builder = Configuration.get_base_uri
|
650
|
+
_query_builder << '/response/1123datetime'
|
651
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
652
|
+
_query_builder,
|
653
|
+
{
|
654
|
+
'array' => true
|
655
|
+
},
|
656
|
+
array_serialization: Configuration.array_serialization
|
657
|
+
)
|
658
|
+
_query_url = APIHelper.clean_url _query_builder
|
659
|
+
|
660
|
+
# Prepare headers.
|
661
|
+
_headers = {
|
662
|
+
'accept' => 'application/json'
|
663
|
+
}
|
664
|
+
|
665
|
+
# Prepare and execute HttpRequest.
|
666
|
+
_request = @http_client.get(
|
667
|
+
_query_url,
|
668
|
+
headers: _headers
|
669
|
+
)
|
670
|
+
_context = execute_request(_request)
|
671
|
+
|
672
|
+
# Validate response against endpoint and global error codes.
|
673
|
+
return nil if _context.response.status_code == 404
|
674
|
+
validate_response(_context)
|
675
|
+
|
676
|
+
# Return appropriate response type.
|
677
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
678
|
+
decoded.map { |element| DateTime.httpdate(element) }
|
679
|
+
end
|
680
|
+
|
681
|
+
# TODO: type endpoint description here
|
682
|
+
# @return List of DateTime response from the API call
|
683
|
+
def get_unix_date_time_array
|
684
|
+
# Prepare query url.
|
685
|
+
_query_builder = Configuration.get_base_uri
|
686
|
+
_query_builder << '/response/unixdatetime'
|
687
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
688
|
+
_query_builder,
|
689
|
+
{
|
690
|
+
'array' => true
|
691
|
+
},
|
692
|
+
array_serialization: Configuration.array_serialization
|
693
|
+
)
|
694
|
+
_query_url = APIHelper.clean_url _query_builder
|
695
|
+
|
696
|
+
# Prepare headers.
|
697
|
+
_headers = {
|
698
|
+
'accept' => 'application/json'
|
699
|
+
}
|
700
|
+
|
701
|
+
# Prepare and execute HttpRequest.
|
702
|
+
_request = @http_client.get(
|
703
|
+
_query_url,
|
704
|
+
headers: _headers
|
705
|
+
)
|
706
|
+
_context = execute_request(_request)
|
707
|
+
|
708
|
+
# Validate response against endpoint and global error codes.
|
709
|
+
return nil if _context.response.status_code == 404
|
710
|
+
validate_response(_context)
|
711
|
+
|
712
|
+
# Return appropriate response type.
|
713
|
+
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
714
|
+
decoded.map { |element| Time.at(element).utc.to_datetime }
|
715
|
+
end
|
716
|
+
end
|
717
|
+
end
|