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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b842337956e6cf43da9de7e322551bbda8d0d39d639aaf02a4042a9f831b561
4
- data.tar.gz: 1b15c2df34e6c79fd080d057ed0762e877761a95176a474e619cabf77b65b933
3
+ metadata.gz: 1a895b819a7bf73fb17ba12f60b70444f7a5684fb6cc64a797dc36c55d3298c6
4
+ data.tar.gz: cfb7a756e55d02c10bce1fcbe61fbce7f2f2c9aec4ce3808082bc8916c3afaf2
5
5
  SHA512:
6
- metadata.gz: d6026f6c20eee344201b46370aaf8a6c092276563a3dfa77653bb2b021e1e4f1702d39167dbce57709ecc9b05b55a9c60b26bbfeb7162d0980cc34cd36d1b5f3
7
- data.tar.gz: 700de9dfc161d630bbaf0afb1a761091c96987bfe1956df2860d7f96ab5101ad553b7d032ee86695173858a7ab859c136514a845997b9aaf26ae76a6931bc96a
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
- data = deserialize(response, opts[:return_type])
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 hearder and query params based on authentication settings.
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` of `header`'
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
- # use application/json by default
339
- return 'application/json' if content_types.nil? || content_types.empty?
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: 1.2.15
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 = '1.2.15'
14
+ VERSION = '2.0.0'
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autosde_openapi_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.15
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator