pulp_maven_client 0.1.0b3.dev0.1561664543 → 0.1.0b3.dev01565206788
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pulp_maven_client might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/docs/InlineResponse200.md +3 -3
- data/docs/InlineResponse2001.md +3 -3
- data/docs/InlineResponse2002.md +3 -3
- data/docs/MavenRemote.md +1 -3
- data/lib/pulp_maven_client/api/content_artifact_api.rb +3 -3
- data/lib/pulp_maven_client/api/distributions_maven_api.rb +6 -6
- data/lib/pulp_maven_client/api/remotes_maven_api.rb +6 -6
- data/lib/pulp_maven_client/api_client.rb +53 -38
- data/lib/pulp_maven_client/api_error.rb +1 -1
- data/lib/pulp_maven_client/configuration.rb +13 -21
- data/lib/pulp_maven_client/models/async_operation_response.rb +1 -1
- data/lib/pulp_maven_client/models/inline_response200.rb +11 -11
- data/lib/pulp_maven_client/models/inline_response2001.rb +11 -11
- data/lib/pulp_maven_client/models/inline_response2002.rb +11 -11
- data/lib/pulp_maven_client/models/maven_artifact.rb +1 -1
- data/lib/pulp_maven_client/models/maven_distribution.rb +1 -1
- data/lib/pulp_maven_client/models/maven_remote.rb +5 -15
- data/lib/pulp_maven_client/version.rb +2 -2
- data/lib/pulp_maven_client.rb +1 -1
- data/pulp_maven_client.gemspec +3 -9
- data/spec/api/content_artifact_api_spec.rb +1 -1
- data/spec/api/distributions_maven_api_spec.rb +1 -1
- data/spec/api/remotes_maven_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -39
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/async_operation_response_spec.rb +1 -1
- data/spec/models/inline_response2001_spec.rb +4 -4
- data/spec/models/inline_response2002_spec.rb +4 -4
- data/spec/models/inline_response200_spec.rb +4 -4
- data/spec/models/maven_artifact_spec.rb +1 -1
- data/spec/models/maven_distribution_spec.rb +1 -1
- data/spec/models/maven_remote_spec.rb +2 -8
- data/spec/spec_helper.rb +1 -1
- metadata +6 -133
- data/Gemfile.lock +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b4965a2df41a54b3e57e89797222a9d9d5951c653e94b12ce1a1656303a13ce
|
4
|
+
data.tar.gz: 71b83951f19caf2094ebaddcdb977677ca3df511de141253e7ebe54589d1bc83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 845bd969bf56ef6382ba4304a1e816af7900bd95611e4963a576ab925608fe4ea0c3903108a49ae90c07badf1c927766d43be468bd63091149a0914ff2d37f55
|
7
|
+
data.tar.gz: d57623570e30c65eee11dcd08f0e0d6f027db0f0ff9322208a0e3dfb8e844ad25d5665181366800b203d09af9fed142bd26e6e0896e0e3aacdc3d4a4756946e1
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: v3
|
10
|
-
- Package version: 0.1.0b3.
|
10
|
+
- Package version: 0.1.0b3.dev01565206788
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
|
13
13
|
## Installation
|
@@ -23,16 +23,16 @@ gem build pulp_maven_client.gemspec
|
|
23
23
|
Then either install the gem locally:
|
24
24
|
|
25
25
|
```shell
|
26
|
-
gem install ./pulp_maven_client-0.1.0b3.
|
26
|
+
gem install ./pulp_maven_client-0.1.0b3.dev01565206788.gem
|
27
27
|
```
|
28
28
|
|
29
|
-
(for development, run `gem install --dev ./pulp_maven_client-0.1.0b3.
|
29
|
+
(for development, run `gem install --dev ./pulp_maven_client-0.1.0b3.dev01565206788.gem` to install the development dependencies)
|
30
30
|
|
31
31
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
32
|
|
33
33
|
Finally add this to the Gemfile:
|
34
34
|
|
35
|
-
gem 'pulp_maven_client', '~> 0.1.0b3.
|
35
|
+
gem 'pulp_maven_client', '~> 0.1.0b3.dev01565206788'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -59,8 +59,8 @@ require 'pulp_maven_client'
|
|
59
59
|
# Setup authorization
|
60
60
|
PulpMavenClient.configure do |config|
|
61
61
|
# Configure HTTP basic authorization: Basic
|
62
|
-
config.username = '
|
63
|
-
config.password = '
|
62
|
+
config.username = 'YOUR_USERNAME'
|
63
|
+
config.password = 'YOUR_PASSWORD'
|
64
64
|
end
|
65
65
|
|
66
66
|
api_instance = PulpMavenClient::ContentArtifactApi.new
|
data/docs/InlineResponse200.md
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
+
**count** | **Integer** | |
|
7
8
|
**_next** | **String** | | [optional]
|
8
9
|
**previous** | **String** | | [optional]
|
9
|
-
**count** | **Integer** | |
|
10
10
|
**results** | [**Array<MavenArtifact>**](MavenArtifact.md) | |
|
11
11
|
|
12
12
|
## Code Sample
|
@@ -14,9 +14,9 @@ Name | Type | Description | Notes
|
|
14
14
|
```ruby
|
15
15
|
require 'PulpMavenClient'
|
16
16
|
|
17
|
-
instance = PulpMavenClient::InlineResponse200.new(
|
17
|
+
instance = PulpMavenClient::InlineResponse200.new(count: null,
|
18
|
+
_next: null,
|
18
19
|
previous: null,
|
19
|
-
count: null,
|
20
20
|
results: null)
|
21
21
|
```
|
22
22
|
|
data/docs/InlineResponse2001.md
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
+
**count** | **Integer** | |
|
7
8
|
**_next** | **String** | | [optional]
|
8
9
|
**previous** | **String** | | [optional]
|
9
|
-
**count** | **Integer** | |
|
10
10
|
**results** | [**Array<MavenDistribution>**](MavenDistribution.md) | |
|
11
11
|
|
12
12
|
## Code Sample
|
@@ -14,9 +14,9 @@ Name | Type | Description | Notes
|
|
14
14
|
```ruby
|
15
15
|
require 'PulpMavenClient'
|
16
16
|
|
17
|
-
instance = PulpMavenClient::InlineResponse2001.new(
|
17
|
+
instance = PulpMavenClient::InlineResponse2001.new(count: null,
|
18
|
+
_next: null,
|
18
19
|
previous: null,
|
19
|
-
count: null,
|
20
20
|
results: null)
|
21
21
|
```
|
22
22
|
|
data/docs/InlineResponse2002.md
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
+
**count** | **Integer** | |
|
7
8
|
**_next** | **String** | | [optional]
|
8
9
|
**previous** | **String** | | [optional]
|
9
|
-
**count** | **Integer** | |
|
10
10
|
**results** | [**Array<MavenRemote>**](MavenRemote.md) | |
|
11
11
|
|
12
12
|
## Code Sample
|
@@ -14,9 +14,9 @@ Name | Type | Description | Notes
|
|
14
14
|
```ruby
|
15
15
|
require 'PulpMavenClient'
|
16
16
|
|
17
|
-
instance = PulpMavenClient::InlineResponse2002.new(
|
17
|
+
instance = PulpMavenClient::InlineResponse2002.new(count: null,
|
18
|
+
_next: null,
|
18
19
|
previous: null,
|
19
|
-
count: null,
|
20
20
|
results: null)
|
21
21
|
```
|
22
22
|
|
data/docs/MavenRemote.md
CHANGED
@@ -9,7 +9,6 @@ Name | Type | Description | Notes
|
|
9
9
|
**_type** | **String** | | [optional]
|
10
10
|
**name** | **String** | A unique name for this remote. |
|
11
11
|
**url** | **String** | The URL of an external content source. |
|
12
|
-
**validate** | **Boolean** | If True, the plugin will validate imported artifacts. | [optional]
|
13
12
|
**ssl_ca_certificate** | **String** | A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped. Returns SHA256 sum on GET. | [optional]
|
14
13
|
**ssl_client_certificate** | **String** | A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 sum on GET. | [optional]
|
15
14
|
**ssl_client_key** | **String** | A PEM encoded private key used for authentication. Returns SHA256 sum on GET. | [optional]
|
@@ -19,7 +18,7 @@ Name | Type | Description | Notes
|
|
19
18
|
**password** | **String** | The password to be used for authentication when syncing. | [optional]
|
20
19
|
**_last_updated** | **DateTime** | Timestamp of the most recent update of the remote. | [optional]
|
21
20
|
**download_concurrency** | **Integer** | Total number of simultaneous connections. | [optional]
|
22
|
-
**policy** | **String** | The policy to use when downloading content.
|
21
|
+
**policy** | **String** | The policy to use when downloading content. | [optional] [default to 'immediate']
|
23
22
|
|
24
23
|
## Code Sample
|
25
24
|
|
@@ -31,7 +30,6 @@ instance = PulpMavenClient::MavenRemote.new(_href: null,
|
|
31
30
|
_type: null,
|
32
31
|
name: null,
|
33
32
|
url: null,
|
34
|
-
validate: null,
|
35
33
|
ssl_ca_certificate: null,
|
36
34
|
ssl_client_certificate: null,
|
37
35
|
ssl_client_key: null,
|
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpMavenClient
|
16
16
|
class ContentArtifactApi
|
@@ -190,7 +190,7 @@ module PulpMavenClient
|
|
190
190
|
fail ArgumentError, "Missing the required parameter 'maven_artifact_href' when calling ContentArtifactApi.read"
|
191
191
|
end
|
192
192
|
# resource path
|
193
|
-
local_var_path = '{maven_artifact_href}'.sub('{' + 'maven_artifact_href' + '}', maven_artifact_href.to_s)
|
193
|
+
local_var_path = '{maven_artifact_href}'.sub('{' + 'maven_artifact_href' + '}', CGI.escape(maven_artifact_href.to_s).gsub('%2F', '/'))
|
194
194
|
|
195
195
|
# query parameters
|
196
196
|
query_params = opts[:query_params] || {}
|
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpMavenClient
|
16
16
|
class DistributionsMavenApi
|
@@ -107,7 +107,7 @@ module PulpMavenClient
|
|
107
107
|
fail ArgumentError, "Missing the required parameter 'maven_distribution_href' when calling DistributionsMavenApi.delete"
|
108
108
|
end
|
109
109
|
# resource path
|
110
|
-
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', maven_distribution_href.to_s)
|
110
|
+
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', CGI.escape(maven_distribution_href.to_s).gsub('%2F', '/'))
|
111
111
|
|
112
112
|
# query parameters
|
113
113
|
query_params = opts[:query_params] || {}
|
@@ -255,7 +255,7 @@ module PulpMavenClient
|
|
255
255
|
fail ArgumentError, "Missing the required parameter 'data' when calling DistributionsMavenApi.partial_update"
|
256
256
|
end
|
257
257
|
# resource path
|
258
|
-
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', maven_distribution_href.to_s)
|
258
|
+
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', CGI.escape(maven_distribution_href.to_s).gsub('%2F', '/'))
|
259
259
|
|
260
260
|
# query parameters
|
261
261
|
query_params = opts[:query_params] || {}
|
@@ -319,7 +319,7 @@ module PulpMavenClient
|
|
319
319
|
fail ArgumentError, "Missing the required parameter 'maven_distribution_href' when calling DistributionsMavenApi.read"
|
320
320
|
end
|
321
321
|
# resource path
|
322
|
-
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', maven_distribution_href.to_s)
|
322
|
+
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', CGI.escape(maven_distribution_href.to_s).gsub('%2F', '/'))
|
323
323
|
|
324
324
|
# query parameters
|
325
325
|
query_params = opts[:query_params] || {}
|
@@ -387,7 +387,7 @@ module PulpMavenClient
|
|
387
387
|
fail ArgumentError, "Missing the required parameter 'data' when calling DistributionsMavenApi.update"
|
388
388
|
end
|
389
389
|
# resource path
|
390
|
-
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', maven_distribution_href.to_s)
|
390
|
+
local_var_path = '{maven_distribution_href}'.sub('{' + 'maven_distribution_href' + '}', CGI.escape(maven_distribution_href.to_s).gsub('%2F', '/'))
|
391
391
|
|
392
392
|
# query parameters
|
393
393
|
query_params = opts[:query_params] || {}
|
@@ -6,11 +6,11 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module PulpMavenClient
|
16
16
|
class RemotesMavenApi
|
@@ -107,7 +107,7 @@ module PulpMavenClient
|
|
107
107
|
fail ArgumentError, "Missing the required parameter 'maven_remote_href' when calling RemotesMavenApi.delete"
|
108
108
|
end
|
109
109
|
# resource path
|
110
|
-
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', maven_remote_href.to_s)
|
110
|
+
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', CGI.escape(maven_remote_href.to_s).gsub('%2F', '/'))
|
111
111
|
|
112
112
|
# query parameters
|
113
113
|
query_params = opts[:query_params] || {}
|
@@ -261,7 +261,7 @@ module PulpMavenClient
|
|
261
261
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesMavenApi.partial_update"
|
262
262
|
end
|
263
263
|
# resource path
|
264
|
-
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', maven_remote_href.to_s)
|
264
|
+
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', CGI.escape(maven_remote_href.to_s).gsub('%2F', '/'))
|
265
265
|
|
266
266
|
# query parameters
|
267
267
|
query_params = opts[:query_params] || {}
|
@@ -325,7 +325,7 @@ module PulpMavenClient
|
|
325
325
|
fail ArgumentError, "Missing the required parameter 'maven_remote_href' when calling RemotesMavenApi.read"
|
326
326
|
end
|
327
327
|
# resource path
|
328
|
-
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', maven_remote_href.to_s)
|
328
|
+
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', CGI.escape(maven_remote_href.to_s).gsub('%2F', '/'))
|
329
329
|
|
330
330
|
# query parameters
|
331
331
|
query_params = opts[:query_params] || {}
|
@@ -393,7 +393,7 @@ module PulpMavenClient
|
|
393
393
|
fail ArgumentError, "Missing the required parameter 'data' when calling RemotesMavenApi.update"
|
394
394
|
end
|
395
395
|
# resource path
|
396
|
-
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', maven_remote_href.to_s)
|
396
|
+
local_var_path = '{maven_remote_href}'.sub('{' + 'maven_remote_href' + '}', CGI.escape(maven_remote_href.to_s).gsub('%2F', '/'))
|
397
397
|
|
398
398
|
# query parameters
|
399
399
|
query_params = opts[:query_params] || {}
|
@@ -6,16 +6,15 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'faraday'
|
14
15
|
require 'json'
|
15
16
|
require 'logger'
|
16
17
|
require 'tempfile'
|
17
|
-
require 'typhoeus'
|
18
|
-
require 'uri'
|
19
18
|
|
20
19
|
module PulpMavenClient
|
21
20
|
class ApiClient
|
@@ -47,26 +46,46 @@ module PulpMavenClient
|
|
47
46
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
48
47
|
# the data deserialized from response body (could be nil), response status code and response headers.
|
49
48
|
def call_api(http_method, path, opts = {})
|
50
|
-
|
51
|
-
|
49
|
+
ssl_options = {
|
50
|
+
:ca_file => @config.ssl_ca_file,
|
51
|
+
:verify => @config.ssl_verify,
|
52
|
+
:verify => @config.ssl_verify_mode,
|
53
|
+
:client_cert => @config.ssl_client_cert,
|
54
|
+
:client_key => @config.ssl_client_key
|
55
|
+
}
|
52
56
|
|
53
|
-
|
54
|
-
|
57
|
+
connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
|
58
|
+
conn.basic_auth(config.username, config.password)
|
59
|
+
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
60
|
+
conn.request :multipart
|
61
|
+
conn.request :url_encoded
|
62
|
+
end
|
63
|
+
conn.adapter(Faraday.default_adapter)
|
55
64
|
end
|
56
65
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
else
|
65
|
-
fail ApiError.new(:code => response.code,
|
66
|
-
:response_headers => response.headers,
|
67
|
-
:response_body => response.body),
|
68
|
-
response.status_message
|
66
|
+
begin
|
67
|
+
response = connection.public_send(http_method.to_sym.downcase) do |req|
|
68
|
+
build_request(http_method, path, req, opts)
|
69
|
+
end
|
70
|
+
|
71
|
+
if @config.debugging
|
72
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
69
73
|
end
|
74
|
+
|
75
|
+
unless response.success?
|
76
|
+
if response.status == 0
|
77
|
+
# Errors from libcurl will be made visible here
|
78
|
+
fail ApiError.new(:code => 0,
|
79
|
+
:message => response.return_message)
|
80
|
+
else
|
81
|
+
fail ApiError.new(:code => response.status,
|
82
|
+
:response_headers => response.headers,
|
83
|
+
:response_body => response.body),
|
84
|
+
response.reason_phrase
|
85
|
+
end
|
86
|
+
end
|
87
|
+
rescue Faraday::TimeoutError
|
88
|
+
fail ApiError.new('Connection timed out')
|
70
89
|
end
|
71
90
|
|
72
91
|
if opts[:return_type]
|
@@ -74,7 +93,7 @@ module PulpMavenClient
|
|
74
93
|
else
|
75
94
|
data = nil
|
76
95
|
end
|
77
|
-
return data, response.
|
96
|
+
return data, response.status, response.headers
|
78
97
|
end
|
79
98
|
|
80
99
|
# Builds the HTTP request
|
@@ -86,7 +105,7 @@ module PulpMavenClient
|
|
86
105
|
# @option opts [Hash] :form_params Query parameters
|
87
106
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
88
107
|
# @return [Typhoeus::Request] A Typhoeus Request
|
89
|
-
def build_request(http_method, path, opts = {})
|
108
|
+
def build_request(http_method, path, request, opts = {})
|
90
109
|
url = build_request_url(path)
|
91
110
|
http_method = http_method.to_sym.downcase
|
92
111
|
|
@@ -96,25 +115,15 @@ module PulpMavenClient
|
|
96
115
|
|
97
116
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
98
117
|
|
99
|
-
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
100
|
-
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
101
|
-
|
102
118
|
req_opts = {
|
103
119
|
:method => http_method,
|
104
120
|
:headers => header_params,
|
105
121
|
:params => query_params,
|
106
122
|
:params_encoding => @config.params_encoding,
|
107
123
|
:timeout => @config.timeout,
|
108
|
-
:ssl_verifypeer => @config.verify_ssl,
|
109
|
-
:ssl_verifyhost => _verify_ssl_host,
|
110
|
-
:sslcert => @config.cert_file,
|
111
|
-
:sslkey => @config.key_file,
|
112
124
|
:verbose => @config.debugging
|
113
125
|
}
|
114
126
|
|
115
|
-
# set custom cert, if provided
|
116
|
-
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
117
|
-
|
118
127
|
if [:post, :patch, :put, :delete].include?(http_method)
|
119
128
|
req_body = build_request_body(header_params, form_params, opts[:body])
|
120
129
|
req_opts.update :body => req_body
|
@@ -122,8 +131,10 @@ module PulpMavenClient
|
|
122
131
|
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
123
132
|
end
|
124
133
|
end
|
125
|
-
|
126
|
-
request =
|
134
|
+
request.headers = header_params
|
135
|
+
request.body = req_body
|
136
|
+
request.url url
|
137
|
+
request.params = query_params
|
127
138
|
download_file(request) if opts[:return_type] == 'File'
|
128
139
|
request
|
129
140
|
end
|
@@ -262,7 +273,7 @@ module PulpMavenClient
|
|
262
273
|
def build_request_url(path)
|
263
274
|
# Add leading and trailing slashes to path
|
264
275
|
path = "/#{path}".gsub(/\/+/, '/')
|
265
|
-
|
276
|
+
@config.base_url + path
|
266
277
|
end
|
267
278
|
|
268
279
|
# Builds the HTTP request body
|
@@ -273,13 +284,17 @@ module PulpMavenClient
|
|
273
284
|
# @return [String] HTTP body data in the form of string
|
274
285
|
def build_request_body(header_params, form_params, body)
|
275
286
|
# http form
|
276
|
-
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
277
|
-
|
287
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
288
|
+
data = URI.encode_www_form(form_params)
|
289
|
+
elsif header_params['Content-Type'] == 'multipart/form-data'
|
278
290
|
data = {}
|
279
291
|
form_params.each do |key, value|
|
280
292
|
case value
|
281
|
-
when ::File, ::
|
282
|
-
#
|
293
|
+
when ::File, ::Tempfile
|
294
|
+
# TODO hardcode to application/octet-stream, need better way to detect content type
|
295
|
+
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
296
|
+
when ::Array, nil
|
297
|
+
# let Faraday handle Array and nil parameters
|
283
298
|
data[key] = value
|
284
299
|
else
|
285
300
|
data[key] = value.to_s
|
@@ -6,12 +6,10 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require 'uri'
|
14
|
-
|
15
13
|
module PulpMavenClient
|
16
14
|
class Configuration
|
17
15
|
# Defines url scheme
|
@@ -88,33 +86,28 @@ module PulpMavenClient
|
|
88
86
|
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
89
87
|
#
|
90
88
|
# @return [true, false]
|
91
|
-
attr_accessor :
|
89
|
+
attr_accessor :ssl_verify
|
92
90
|
|
93
91
|
### TLS/SSL setting
|
94
|
-
#
|
95
|
-
# Default to true.
|
92
|
+
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
96
93
|
#
|
97
94
|
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
98
95
|
#
|
99
|
-
|
100
|
-
attr_accessor :verify_ssl_host
|
96
|
+
attr_accessor :ssl_verify_mode
|
101
97
|
|
102
98
|
### TLS/SSL setting
|
103
99
|
# Set this to customize the certificate file to verify the peer.
|
104
100
|
#
|
105
101
|
# @return [String] the path to the certificate file
|
106
|
-
|
107
|
-
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
108
|
-
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
109
|
-
attr_accessor :ssl_ca_cert
|
102
|
+
attr_accessor :ssl_ca_file
|
110
103
|
|
111
104
|
### TLS/SSL setting
|
112
105
|
# Client certificate file (for client certificate)
|
113
|
-
attr_accessor :
|
106
|
+
attr_accessor :ssl_client_cert
|
114
107
|
|
115
108
|
### TLS/SSL setting
|
116
109
|
# Client private key file (for client certificate)
|
117
|
-
attr_accessor :
|
110
|
+
attr_accessor :ssl_client_key
|
118
111
|
|
119
112
|
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
120
113
|
# Default to nil.
|
@@ -135,11 +128,11 @@ module PulpMavenClient
|
|
135
128
|
@api_key_prefix = {}
|
136
129
|
@timeout = 0
|
137
130
|
@client_side_validation = true
|
138
|
-
@
|
139
|
-
@
|
140
|
-
@
|
141
|
-
@
|
142
|
-
@
|
131
|
+
@ssl_verify = true
|
132
|
+
@ssl_verify_mode = nil
|
133
|
+
@ssl_ca_file = nil
|
134
|
+
@ssl_client_cert = nil
|
135
|
+
@ssl_client_key = nil
|
143
136
|
@debugging = false
|
144
137
|
@inject_format = false
|
145
138
|
@force_ending_format = false
|
@@ -174,8 +167,7 @@ module PulpMavenClient
|
|
174
167
|
end
|
175
168
|
|
176
169
|
def base_url
|
177
|
-
|
178
|
-
URI.encode(url)
|
170
|
+
"#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
179
171
|
end
|
180
172
|
|
181
173
|
# Gets API key (with prefix if set).
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,20 +14,20 @@ require 'date'
|
|
14
14
|
|
15
15
|
module PulpMavenClient
|
16
16
|
class InlineResponse200
|
17
|
+
attr_accessor :count
|
18
|
+
|
17
19
|
attr_accessor :_next
|
18
20
|
|
19
21
|
attr_accessor :previous
|
20
22
|
|
21
|
-
attr_accessor :count
|
22
|
-
|
23
23
|
attr_accessor :results
|
24
24
|
|
25
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
26
|
def self.attribute_map
|
27
27
|
{
|
28
|
+
:'count' => :'count',
|
28
29
|
:'_next' => :'next',
|
29
30
|
:'previous' => :'previous',
|
30
|
-
:'count' => :'count',
|
31
31
|
:'results' => :'results'
|
32
32
|
}
|
33
33
|
end
|
@@ -35,9 +35,9 @@ module PulpMavenClient
|
|
35
35
|
# Attribute type mapping.
|
36
36
|
def self.openapi_types
|
37
37
|
{
|
38
|
+
:'count' => :'Integer',
|
38
39
|
:'_next' => :'String',
|
39
40
|
:'previous' => :'String',
|
40
|
-
:'count' => :'Integer',
|
41
41
|
:'results' => :'Array<MavenArtifact>'
|
42
42
|
}
|
43
43
|
end
|
@@ -57,6 +57,10 @@ module PulpMavenClient
|
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
59
59
|
|
60
|
+
if attributes.key?(:'count')
|
61
|
+
self.count = attributes[:'count']
|
62
|
+
end
|
63
|
+
|
60
64
|
if attributes.key?(:'_next')
|
61
65
|
self._next = attributes[:'_next']
|
62
66
|
end
|
@@ -65,10 +69,6 @@ module PulpMavenClient
|
|
65
69
|
self.previous = attributes[:'previous']
|
66
70
|
end
|
67
71
|
|
68
|
-
if attributes.key?(:'count')
|
69
|
-
self.count = attributes[:'count']
|
70
|
-
end
|
71
|
-
|
72
72
|
if attributes.key?(:'results')
|
73
73
|
if (value = attributes[:'results']).is_a?(Array)
|
74
74
|
self.results = value
|
@@ -104,9 +104,9 @@ module PulpMavenClient
|
|
104
104
|
def ==(o)
|
105
105
|
return true if self.equal?(o)
|
106
106
|
self.class == o.class &&
|
107
|
+
count == o.count &&
|
107
108
|
_next == o._next &&
|
108
109
|
previous == o.previous &&
|
109
|
-
count == o.count &&
|
110
110
|
results == o.results
|
111
111
|
end
|
112
112
|
|
@@ -119,7 +119,7 @@ module PulpMavenClient
|
|
119
119
|
# Calculates hash code according to all attributes.
|
120
120
|
# @return [Integer] Hash code
|
121
121
|
def hash
|
122
|
-
[_next, previous,
|
122
|
+
[count, _next, previous, results].hash
|
123
123
|
end
|
124
124
|
|
125
125
|
# Builds the object from hash
|