autosde_openapi_client 1.2.15 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autosde_openapi_client/api_client.rb +27 -8
- data/lib/autosde_openapi_client/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a895b819a7bf73fb17ba12f60b70444f7a5684fb6cc64a797dc36c55d3298c6
|
4
|
+
data.tar.gz: cfb7a756e55d02c10bce1fcbe61fbce7f2f2c9aec4ce3808082bc8916c3afaf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22b74a8e39d16f918051459ff1a24d09c25d4735a51d6f7aaf4893d1fb69d077a63a3fb352db9951a91448a1bad23d823472b58020f129a54497afd2a65085e
|
7
|
+
data.tar.gz: e621a20465af8695dd0015aa9736466da4ad4d74e5b2b87e39f755666a3ee32996c7ee5c77aeec91813e9a1311a5b41d7a7a07ac5bf12558a4335c4b7bfc3a28
|
@@ -70,7 +70,25 @@ module AutosdeOpenapiClient
|
|
70
70
|
end
|
71
71
|
|
72
72
|
if opts[:return_type]
|
73
|
-
|
73
|
+
content = JSON(response.body)
|
74
|
+
new_body=response.body
|
75
|
+
if content.include? 'results'
|
76
|
+
res = content['results']
|
77
|
+
next_url = content['next']
|
78
|
+
|
79
|
+
while next_url
|
80
|
+
uri = URI.parse(next_url)
|
81
|
+
opts[:query_params] = Rack::Utils.parse_query(URI(uri).query)
|
82
|
+
request = build_request(http_method, path, opts)
|
83
|
+
response = request.run
|
84
|
+
content = JSON(response.body)
|
85
|
+
|
86
|
+
res.concat(content['results'])
|
87
|
+
next_url = content['next']
|
88
|
+
end
|
89
|
+
new_body = (JSON.dump(res)).encode()
|
90
|
+
end
|
91
|
+
data = deserialize(response,new_body, opts[:return_type])
|
74
92
|
else
|
75
93
|
data = nil
|
76
94
|
end
|
@@ -93,6 +111,7 @@ module AutosdeOpenapiClient
|
|
93
111
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
94
112
|
query_params = opts[:query_params] || {}
|
95
113
|
form_params = opts[:form_params] || {}
|
114
|
+
follow_location = opts[:follow_location] || true
|
96
115
|
|
97
116
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
98
117
|
|
@@ -109,7 +128,8 @@ module AutosdeOpenapiClient
|
|
109
128
|
:ssl_verifyhost => _verify_ssl_host,
|
110
129
|
:sslcert => @config.cert_file,
|
111
130
|
:sslkey => @config.key_file,
|
112
|
-
:verbose => @config.debugging
|
131
|
+
:verbose => @config.debugging,
|
132
|
+
:followlocation => follow_location
|
113
133
|
}
|
114
134
|
|
115
135
|
# set custom cert, if provided
|
@@ -210,8 +230,7 @@ module AutosdeOpenapiClient
|
|
210
230
|
#
|
211
231
|
# @param [Response] response HTTP response
|
212
232
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
213
|
-
def deserialize(response, return_type)
|
214
|
-
body = response.body
|
233
|
+
def deserialize(response, body, return_type)
|
215
234
|
|
216
235
|
# handle file downloading - return the File instance processed in request callbacks
|
217
236
|
# note that response body is empty when the file is written in chunks in request on_body callback
|
@@ -296,7 +315,7 @@ module AutosdeOpenapiClient
|
|
296
315
|
@config.base_url(opts[:operation]) + path
|
297
316
|
end
|
298
317
|
|
299
|
-
# Update
|
318
|
+
# Update header and query params based on authentication settings.
|
300
319
|
#
|
301
320
|
# @param [Hash] header_params Header parameters
|
302
321
|
# @param [Hash] query_params Query parameters
|
@@ -308,7 +327,7 @@ module AutosdeOpenapiClient
|
|
308
327
|
case auth_setting[:in]
|
309
328
|
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
310
329
|
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
311
|
-
else fail ArgumentError, 'Authentication token must be in `query`
|
330
|
+
else fail ArgumentError, 'Authentication token must be in `query` or `header`'
|
312
331
|
end
|
313
332
|
end
|
314
333
|
end
|
@@ -335,8 +354,8 @@ module AutosdeOpenapiClient
|
|
335
354
|
# @param [Array] content_types array for Content-Type
|
336
355
|
# @return [String] the Content-Type header (e.g. application/json)
|
337
356
|
def select_header_content_type(content_types)
|
338
|
-
#
|
339
|
-
return
|
357
|
+
# return nil by default
|
358
|
+
return if content_types.nil? || content_types.empty?
|
340
359
|
# use JSON when present, otherwise use the first one
|
341
360
|
json_content_type = content_types.find { |s| json_mime?(s) }
|
342
361
|
json_content_type || content_types.first
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#Site Manager API
|
5
5
|
|
6
|
-
The version of the OpenAPI document:
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
7
|
Contact: autosde@il.ibm.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 5.0.0
|
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.0.0
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
module AutosdeOpenapiClient
|
14
|
-
VERSION = '
|
14
|
+
VERSION = '2.0.0'
|
15
15
|
end
|