pulp_python_client 3.0.0b10 → 3.0.0b11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -33
- data/docs/ContentPackagesApi.md +52 -52
- data/docs/ContentSummary.md +3 -3
- data/docs/ContentSummaryResponse.md +21 -0
- data/docs/DistributionsPypiApi.md +108 -60
- data/docs/InlineResponse200.md +3 -3
- data/docs/InlineResponse2001.md +3 -3
- data/docs/InlineResponse2002.md +3 -3
- data/docs/InlineResponse2003.md +3 -3
- data/docs/InlineResponse2004.md +3 -3
- data/docs/InlineResponse2005.md +3 -3
- data/docs/PatchedpythonPythonDistribution.md +23 -0
- data/docs/PatchedpythonPythonRemote.md +43 -0
- data/docs/PatchedpythonPythonRepository.md +21 -0
- data/docs/PolicyEnum.md +16 -0
- data/docs/PublicationsPypiApi.md +40 -40
- data/docs/PythonBanderRemote.md +19 -0
- data/docs/PythonPythonDistribution.md +1 -7
- data/docs/PythonPythonDistributionResponse.md +29 -0
- data/docs/PythonPythonPackageContent.md +7 -15
- data/docs/PythonPythonPackageContentResponse.md +69 -0
- data/docs/PythonPythonPublication.md +2 -8
- data/docs/PythonPythonPublicationResponse.md +25 -0
- data/docs/PythonPythonRemote.md +4 -10
- data/docs/PythonPythonRemoteResponse.md +49 -0
- data/docs/PythonPythonRepository.md +4 -10
- data/docs/PythonPythonRepositoryResponse.md +29 -0
- data/docs/RemotesPythonApi.md +129 -69
- data/docs/RepositoriesPythonApi.md +97 -73
- data/docs/RepositoriesPythonVersionsApi.md +94 -62
- data/docs/RepositoryAddRemoveContent.md +2 -2
- data/docs/RepositorySyncURL.md +1 -1
- data/docs/RepositoryVersion.md +1 -9
- data/docs/RepositoryVersionResponse.md +25 -0
- data/lib/pulp_python_client.rb +14 -2
- data/lib/pulp_python_client/api/content_packages_api.rb +70 -70
- data/lib/pulp_python_client/api/distributions_pypi_api.rb +153 -90
- data/lib/pulp_python_client/api/publications_pypi_api.rb +59 -59
- data/lib/pulp_python_client/api/remotes_python_api.rb +185 -108
- data/lib/pulp_python_client/api/repositories_python_api.rb +145 -118
- data/lib/pulp_python_client/api/repositories_python_versions_api.rb +137 -92
- data/lib/pulp_python_client/api_client.rb +2 -2
- data/lib/pulp_python_client/api_error.rb +2 -2
- data/lib/pulp_python_client/configuration.rb +3 -3
- data/lib/pulp_python_client/models/async_operation_response.rb +3 -2
- data/lib/pulp_python_client/models/content_summary.rb +9 -15
- data/lib/pulp_python_client/models/content_summary_response.rb +240 -0
- data/lib/pulp_python_client/models/inline_response200.rb +3 -13
- data/lib/pulp_python_client/models/inline_response2001.rb +3 -13
- data/lib/pulp_python_client/models/inline_response2002.rb +3 -13
- data/lib/pulp_python_client/models/inline_response2003.rb +3 -13
- data/lib/pulp_python_client/models/inline_response2004.rb +3 -13
- data/lib/pulp_python_client/models/inline_response2005.rb +3 -13
- data/lib/pulp_python_client/models/patchedpython_python_distribution.rb +240 -0
- data/lib/pulp_python_client/models/patchedpython_python_remote.rb +359 -0
- data/lib/pulp_python_client/models/patchedpython_python_repository.rb +229 -0
- data/lib/pulp_python_client/models/policy_enum.rb +37 -0
- data/lib/pulp_python_client/models/python_bander_remote.rb +228 -0
- data/lib/pulp_python_client/models/python_python_distribution.rb +4 -85
- data/lib/pulp_python_client/models/python_python_distribution_response.rb +279 -0
- data/lib/pulp_python_client/models/python_python_package_content.rb +28 -136
- data/lib/pulp_python_client/models/python_python_package_content_response.rb +467 -0
- data/lib/pulp_python_client/models/python_python_publication.rb +7 -37
- data/lib/pulp_python_client/models/python_python_publication_response.rb +248 -0
- data/lib/pulp_python_client/models/python_python_remote.rb +7 -199
- data/lib/pulp_python_client/models/python_python_remote_response.rb +398 -0
- data/lib/pulp_python_client/models/python_python_repository.rb +18 -78
- data/lib/pulp_python_client/models/python_python_repository_response.rb +271 -0
- data/lib/pulp_python_client/models/repository_add_remove_content.rb +5 -4
- data/lib/pulp_python_client/models/repository_sync_url.rb +3 -8
- data/lib/pulp_python_client/models/repository_version.rb +7 -43
- data/lib/pulp_python_client/models/repository_version_response.rb +246 -0
- data/lib/pulp_python_client/version.rb +3 -3
- data/pulp_python_client.gemspec +4 -4
- data/spec/api/content_packages_api_spec.rb +24 -24
- data/spec/api/distributions_pypi_api_spec.rb +39 -18
- data/spec/api/publications_pypi_api_spec.rb +14 -14
- data/spec/api/remotes_python_api_spec.rb +49 -22
- data/spec/api/repositories_python_api_spec.rb +28 -19
- data/spec/api/repositories_python_versions_api_spec.rb +38 -23
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/async_operation_response_spec.rb +2 -2
- data/spec/models/content_summary_response_spec.rb +53 -0
- data/spec/models/content_summary_spec.rb +2 -2
- data/spec/models/inline_response2001_spec.rb +2 -2
- data/spec/models/inline_response2002_spec.rb +2 -2
- data/spec/models/inline_response2003_spec.rb +2 -2
- data/spec/models/inline_response2004_spec.rb +2 -2
- data/spec/models/inline_response2005_spec.rb +2 -2
- data/spec/models/inline_response200_spec.rb +2 -2
- data/spec/models/patchedpython_python_distribution_spec.rb +59 -0
- data/spec/models/patchedpython_python_remote_spec.rb +119 -0
- data/spec/models/patchedpython_python_repository_spec.rb +53 -0
- data/spec/models/policy_enum_spec.rb +35 -0
- data/spec/models/python_bander_remote_spec.rb +47 -0
- data/spec/models/python_python_distribution_response_spec.rb +77 -0
- data/spec/models/python_python_distribution_spec.rb +2 -20
- data/spec/models/python_python_package_content_response_spec.rb +197 -0
- data/spec/models/python_python_package_content_spec.rb +5 -29
- data/spec/models/python_python_publication_response_spec.rb +65 -0
- data/spec/models/python_python_publication_spec.rb +2 -20
- data/spec/models/python_python_remote_response_spec.rb +137 -0
- data/spec/models/python_python_remote_spec.rb +2 -24
- data/spec/models/python_python_repository_response_spec.rb +77 -0
- data/spec/models/python_python_repository_spec.rb +5 -23
- data/spec/models/repository_add_remove_content_spec.rb +2 -2
- data/spec/models/repository_sync_url_spec.rb +2 -2
- data/spec/models/repository_version_response_spec.rb +65 -0
- data/spec/models/repository_version_spec.rb +2 -26
- data/spec/spec_helper.rb +2 -2
- metadata +52 -4
@@ -1,10 +1,10 @@
|
|
1
1
|
=begin
|
2
2
|
#Pulp 3 API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
5
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
|
-
|
7
|
+
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 4.2.3
|
10
10
|
|
@@ -38,7 +38,7 @@ module PulpPythonClient
|
|
38
38
|
:'count' => :'Integer',
|
39
39
|
:'_next' => :'String',
|
40
40
|
:'previous' => :'String',
|
41
|
-
:'results' => :'Array<
|
41
|
+
:'results' => :'Array<PythonPythonRepositoryResponse>'
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
@@ -88,22 +88,12 @@ module PulpPythonClient
|
|
88
88
|
# @return Array for valid properties with the reasons
|
89
89
|
def list_invalid_properties
|
90
90
|
invalid_properties = Array.new
|
91
|
-
if @count.nil?
|
92
|
-
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
93
|
-
end
|
94
|
-
|
95
|
-
if @results.nil?
|
96
|
-
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
97
|
-
end
|
98
|
-
|
99
91
|
invalid_properties
|
100
92
|
end
|
101
93
|
|
102
94
|
# Check to see if the all the properties in the model are valid
|
103
95
|
# @return true if the model is valid
|
104
96
|
def valid?
|
105
|
-
return false if @count.nil?
|
106
|
-
return false if @results.nil?
|
107
97
|
true
|
108
98
|
end
|
109
99
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
=begin
|
2
2
|
#Pulp 3 API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
5
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
|
-
|
7
|
+
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 4.2.3
|
10
10
|
|
@@ -38,7 +38,7 @@ module PulpPythonClient
|
|
38
38
|
:'count' => :'Integer',
|
39
39
|
:'_next' => :'String',
|
40
40
|
:'previous' => :'String',
|
41
|
-
:'results' => :'Array<
|
41
|
+
:'results' => :'Array<RepositoryVersionResponse>'
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
@@ -88,22 +88,12 @@ module PulpPythonClient
|
|
88
88
|
# @return Array for valid properties with the reasons
|
89
89
|
def list_invalid_properties
|
90
90
|
invalid_properties = Array.new
|
91
|
-
if @count.nil?
|
92
|
-
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
93
|
-
end
|
94
|
-
|
95
|
-
if @results.nil?
|
96
|
-
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
97
|
-
end
|
98
|
-
|
99
91
|
invalid_properties
|
100
92
|
end
|
101
93
|
|
102
94
|
# Check to see if the all the properties in the model are valid
|
103
95
|
# @return true if the model is valid
|
104
96
|
def valid?
|
105
|
-
return false if @count.nil?
|
106
|
-
return false if @results.nil?
|
107
97
|
true
|
108
98
|
end
|
109
99
|
|
@@ -0,0 +1,240 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpPythonClient
|
16
|
+
# Serializer for Pulp distributions for the Python type.
|
17
|
+
class PatchedpythonPythonDistribution
|
18
|
+
# The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
|
19
|
+
attr_accessor :base_path
|
20
|
+
|
21
|
+
# An optional content-guard.
|
22
|
+
attr_accessor :content_guard
|
23
|
+
|
24
|
+
# A unique name. Ex, `rawhide` and `stable`.
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# Publication to be served
|
28
|
+
attr_accessor :publication
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'base_path' => :'base_path',
|
34
|
+
:'content_guard' => :'content_guard',
|
35
|
+
:'name' => :'name',
|
36
|
+
:'publication' => :'publication'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'base_path' => :'String',
|
44
|
+
:'content_guard' => :'String',
|
45
|
+
:'name' => :'String',
|
46
|
+
:'publication' => :'String'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# List of attributes with nullable: true
|
51
|
+
def self.openapi_nullable
|
52
|
+
Set.new([
|
53
|
+
:'content_guard',
|
54
|
+
:'publication'
|
55
|
+
])
|
56
|
+
end
|
57
|
+
|
58
|
+
# Initializes the object
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
60
|
+
def initialize(attributes = {})
|
61
|
+
if (!attributes.is_a?(Hash))
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::PatchedpythonPythonDistribution` initialize method"
|
63
|
+
end
|
64
|
+
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::PatchedpythonPythonDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
69
|
+
end
|
70
|
+
h[k.to_sym] = v
|
71
|
+
}
|
72
|
+
|
73
|
+
if attributes.key?(:'base_path')
|
74
|
+
self.base_path = attributes[:'base_path']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'content_guard')
|
78
|
+
self.content_guard = attributes[:'content_guard']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'name')
|
82
|
+
self.name = attributes[:'name']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'publication')
|
86
|
+
self.publication = attributes[:'publication']
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
91
|
+
# @return Array for valid properties with the reasons
|
92
|
+
def list_invalid_properties
|
93
|
+
invalid_properties = Array.new
|
94
|
+
invalid_properties
|
95
|
+
end
|
96
|
+
|
97
|
+
# Check to see if the all the properties in the model are valid
|
98
|
+
# @return true if the model is valid
|
99
|
+
def valid?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
base_path == o.base_path &&
|
109
|
+
content_guard == o.content_guard &&
|
110
|
+
name == o.name &&
|
111
|
+
publication == o.publication
|
112
|
+
end
|
113
|
+
|
114
|
+
# @see the `==` method
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def eql?(o)
|
117
|
+
self == o
|
118
|
+
end
|
119
|
+
|
120
|
+
# Calculates hash code according to all attributes.
|
121
|
+
# @return [Integer] Hash code
|
122
|
+
def hash
|
123
|
+
[base_path, content_guard, name, publication].hash
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def self.build_from_hash(attributes)
|
130
|
+
new.build_from_hash(attributes)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
self.class.openapi_types.each_pair do |key, type|
|
139
|
+
if type =~ /\AArray<(.*)>/i
|
140
|
+
# check to ensure the input is an array given that the attribute
|
141
|
+
# is documented as an array but the input is not
|
142
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
143
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
144
|
+
end
|
145
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
146
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
147
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
148
|
+
end
|
149
|
+
|
150
|
+
self
|
151
|
+
end
|
152
|
+
|
153
|
+
# Deserializes the data based on type
|
154
|
+
# @param string type Data type
|
155
|
+
# @param string value Value to be deserialized
|
156
|
+
# @return [Object] Deserialized data
|
157
|
+
def _deserialize(type, value)
|
158
|
+
case type.to_sym
|
159
|
+
when :DateTime
|
160
|
+
DateTime.parse(value)
|
161
|
+
when :Date
|
162
|
+
Date.parse(value)
|
163
|
+
when :String
|
164
|
+
value.to_s
|
165
|
+
when :Integer
|
166
|
+
value.to_i
|
167
|
+
when :Float
|
168
|
+
value.to_f
|
169
|
+
when :Boolean
|
170
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
171
|
+
true
|
172
|
+
else
|
173
|
+
false
|
174
|
+
end
|
175
|
+
when :Object
|
176
|
+
# generic object (usually a Hash), return directly
|
177
|
+
value
|
178
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
179
|
+
inner_type = Regexp.last_match[:inner_type]
|
180
|
+
value.map { |v| _deserialize(inner_type, v) }
|
181
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
182
|
+
k_type = Regexp.last_match[:k_type]
|
183
|
+
v_type = Regexp.last_match[:v_type]
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each do |k, v|
|
186
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
else # model
|
190
|
+
PulpPythonClient.const_get(type).build_from_hash(value)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Returns the string representation of the object
|
195
|
+
# @return [String] String presentation of the object
|
196
|
+
def to_s
|
197
|
+
to_hash.to_s
|
198
|
+
end
|
199
|
+
|
200
|
+
# to_body is an alias to to_hash (backward compatibility)
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_body
|
203
|
+
to_hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Returns the object in the form of hash
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
208
|
+
def to_hash
|
209
|
+
hash = {}
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
211
|
+
value = self.send(attr)
|
212
|
+
if value.nil?
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
215
|
+
end
|
216
|
+
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Outputs non-array value in the form of hash
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
224
|
+
# @param [Object] value Any valid value
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
226
|
+
def _to_hash(value)
|
227
|
+
if value.is_a?(Array)
|
228
|
+
value.compact.map { |v| _to_hash(v) }
|
229
|
+
elsif value.is_a?(Hash)
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
232
|
+
end
|
233
|
+
elsif value.respond_to? :to_hash
|
234
|
+
value.to_hash
|
235
|
+
else
|
236
|
+
value
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
@@ -0,0 +1,359 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpPythonClient
|
16
|
+
# A Serializer for PythonRemote.
|
17
|
+
class PatchedpythonPythonRemote
|
18
|
+
# A unique name for this remote.
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# The URL of an external content source.
|
22
|
+
attr_accessor :url
|
23
|
+
|
24
|
+
# A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
|
25
|
+
attr_accessor :ca_cert
|
26
|
+
|
27
|
+
# A PEM encoded client certificate used for authentication.
|
28
|
+
attr_accessor :client_cert
|
29
|
+
|
30
|
+
# A PEM encoded private key used for authentication.
|
31
|
+
attr_accessor :client_key
|
32
|
+
|
33
|
+
# If True, TLS peer validation must be performed.
|
34
|
+
attr_accessor :tls_validation
|
35
|
+
|
36
|
+
# The proxy URL. Format: scheme://user:password@host:port
|
37
|
+
attr_accessor :proxy_url
|
38
|
+
|
39
|
+
# The username to be used for authentication when syncing.
|
40
|
+
attr_accessor :username
|
41
|
+
|
42
|
+
# The password to be used for authentication when syncing.
|
43
|
+
attr_accessor :password
|
44
|
+
|
45
|
+
# Total number of simultaneous connections.
|
46
|
+
attr_accessor :download_concurrency
|
47
|
+
|
48
|
+
# The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'cache_only'. 'immediate' is the default.
|
49
|
+
attr_accessor :policy
|
50
|
+
|
51
|
+
# A JSON list containing project specifiers for Python packages to include.
|
52
|
+
attr_accessor :includes
|
53
|
+
|
54
|
+
# A JSON list containing project specifiers for Python packages to exclude.
|
55
|
+
attr_accessor :excludes
|
56
|
+
|
57
|
+
# Whether or not to include pre-release packages in the sync.
|
58
|
+
attr_accessor :prereleases
|
59
|
+
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
61
|
+
def self.attribute_map
|
62
|
+
{
|
63
|
+
:'name' => :'name',
|
64
|
+
:'url' => :'url',
|
65
|
+
:'ca_cert' => :'ca_cert',
|
66
|
+
:'client_cert' => :'client_cert',
|
67
|
+
:'client_key' => :'client_key',
|
68
|
+
:'tls_validation' => :'tls_validation',
|
69
|
+
:'proxy_url' => :'proxy_url',
|
70
|
+
:'username' => :'username',
|
71
|
+
:'password' => :'password',
|
72
|
+
:'download_concurrency' => :'download_concurrency',
|
73
|
+
:'policy' => :'policy',
|
74
|
+
:'includes' => :'includes',
|
75
|
+
:'excludes' => :'excludes',
|
76
|
+
:'prereleases' => :'prereleases'
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Attribute type mapping.
|
81
|
+
def self.openapi_types
|
82
|
+
{
|
83
|
+
:'name' => :'String',
|
84
|
+
:'url' => :'String',
|
85
|
+
:'ca_cert' => :'String',
|
86
|
+
:'client_cert' => :'String',
|
87
|
+
:'client_key' => :'String',
|
88
|
+
:'tls_validation' => :'Boolean',
|
89
|
+
:'proxy_url' => :'String',
|
90
|
+
:'username' => :'String',
|
91
|
+
:'password' => :'String',
|
92
|
+
:'download_concurrency' => :'Integer',
|
93
|
+
:'policy' => :'PolicyEnum',
|
94
|
+
:'includes' => :'Object',
|
95
|
+
:'excludes' => :'Object',
|
96
|
+
:'prereleases' => :'Boolean'
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
# List of attributes with nullable: true
|
101
|
+
def self.openapi_nullable
|
102
|
+
Set.new([
|
103
|
+
:'ca_cert',
|
104
|
+
:'client_cert',
|
105
|
+
:'client_key',
|
106
|
+
:'proxy_url',
|
107
|
+
:'username',
|
108
|
+
:'password',
|
109
|
+
])
|
110
|
+
end
|
111
|
+
|
112
|
+
# Initializes the object
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
def initialize(attributes = {})
|
115
|
+
if (!attributes.is_a?(Hash))
|
116
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::PatchedpythonPythonRemote` initialize method"
|
117
|
+
end
|
118
|
+
|
119
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
120
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
121
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
122
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::PatchedpythonPythonRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
123
|
+
end
|
124
|
+
h[k.to_sym] = v
|
125
|
+
}
|
126
|
+
|
127
|
+
if attributes.key?(:'name')
|
128
|
+
self.name = attributes[:'name']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'url')
|
132
|
+
self.url = attributes[:'url']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'ca_cert')
|
136
|
+
self.ca_cert = attributes[:'ca_cert']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'client_cert')
|
140
|
+
self.client_cert = attributes[:'client_cert']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.key?(:'client_key')
|
144
|
+
self.client_key = attributes[:'client_key']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.key?(:'tls_validation')
|
148
|
+
self.tls_validation = attributes[:'tls_validation']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'proxy_url')
|
152
|
+
self.proxy_url = attributes[:'proxy_url']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'username')
|
156
|
+
self.username = attributes[:'username']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'password')
|
160
|
+
self.password = attributes[:'password']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'download_concurrency')
|
164
|
+
self.download_concurrency = attributes[:'download_concurrency']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'policy')
|
168
|
+
self.policy = attributes[:'policy']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'includes')
|
172
|
+
self.includes = attributes[:'includes']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'excludes')
|
176
|
+
self.excludes = attributes[:'excludes']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'prereleases')
|
180
|
+
self.prereleases = attributes[:'prereleases']
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
185
|
+
# @return Array for valid properties with the reasons
|
186
|
+
def list_invalid_properties
|
187
|
+
invalid_properties = Array.new
|
188
|
+
if !@download_concurrency.nil? && @download_concurrency < 1
|
189
|
+
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
190
|
+
end
|
191
|
+
|
192
|
+
invalid_properties
|
193
|
+
end
|
194
|
+
|
195
|
+
# Check to see if the all the properties in the model are valid
|
196
|
+
# @return true if the model is valid
|
197
|
+
def valid?
|
198
|
+
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
199
|
+
true
|
200
|
+
end
|
201
|
+
|
202
|
+
# Custom attribute writer method with validation
|
203
|
+
# @param [Object] download_concurrency Value to be assigned
|
204
|
+
def download_concurrency=(download_concurrency)
|
205
|
+
if !download_concurrency.nil? && download_concurrency < 1
|
206
|
+
fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
|
207
|
+
end
|
208
|
+
|
209
|
+
@download_concurrency = download_concurrency
|
210
|
+
end
|
211
|
+
|
212
|
+
# Checks equality by comparing each attribute.
|
213
|
+
# @param [Object] Object to be compared
|
214
|
+
def ==(o)
|
215
|
+
return true if self.equal?(o)
|
216
|
+
self.class == o.class &&
|
217
|
+
name == o.name &&
|
218
|
+
url == o.url &&
|
219
|
+
ca_cert == o.ca_cert &&
|
220
|
+
client_cert == o.client_cert &&
|
221
|
+
client_key == o.client_key &&
|
222
|
+
tls_validation == o.tls_validation &&
|
223
|
+
proxy_url == o.proxy_url &&
|
224
|
+
username == o.username &&
|
225
|
+
password == o.password &&
|
226
|
+
download_concurrency == o.download_concurrency &&
|
227
|
+
policy == o.policy &&
|
228
|
+
includes == o.includes &&
|
229
|
+
excludes == o.excludes &&
|
230
|
+
prereleases == o.prereleases
|
231
|
+
end
|
232
|
+
|
233
|
+
# @see the `==` method
|
234
|
+
# @param [Object] Object to be compared
|
235
|
+
def eql?(o)
|
236
|
+
self == o
|
237
|
+
end
|
238
|
+
|
239
|
+
# Calculates hash code according to all attributes.
|
240
|
+
# @return [Integer] Hash code
|
241
|
+
def hash
|
242
|
+
[name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, download_concurrency, policy, includes, excludes, prereleases].hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Builds the object from hash
|
246
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
247
|
+
# @return [Object] Returns the model itself
|
248
|
+
def self.build_from_hash(attributes)
|
249
|
+
new.build_from_hash(attributes)
|
250
|
+
end
|
251
|
+
|
252
|
+
# Builds the object from hash
|
253
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
254
|
+
# @return [Object] Returns the model itself
|
255
|
+
def build_from_hash(attributes)
|
256
|
+
return nil unless attributes.is_a?(Hash)
|
257
|
+
self.class.openapi_types.each_pair do |key, type|
|
258
|
+
if type =~ /\AArray<(.*)>/i
|
259
|
+
# check to ensure the input is an array given that the attribute
|
260
|
+
# is documented as an array but the input is not
|
261
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
262
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
263
|
+
end
|
264
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
265
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
266
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
267
|
+
end
|
268
|
+
|
269
|
+
self
|
270
|
+
end
|
271
|
+
|
272
|
+
# Deserializes the data based on type
|
273
|
+
# @param string type Data type
|
274
|
+
# @param string value Value to be deserialized
|
275
|
+
# @return [Object] Deserialized data
|
276
|
+
def _deserialize(type, value)
|
277
|
+
case type.to_sym
|
278
|
+
when :DateTime
|
279
|
+
DateTime.parse(value)
|
280
|
+
when :Date
|
281
|
+
Date.parse(value)
|
282
|
+
when :String
|
283
|
+
value.to_s
|
284
|
+
when :Integer
|
285
|
+
value.to_i
|
286
|
+
when :Float
|
287
|
+
value.to_f
|
288
|
+
when :Boolean
|
289
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
290
|
+
true
|
291
|
+
else
|
292
|
+
false
|
293
|
+
end
|
294
|
+
when :Object
|
295
|
+
# generic object (usually a Hash), return directly
|
296
|
+
value
|
297
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
298
|
+
inner_type = Regexp.last_match[:inner_type]
|
299
|
+
value.map { |v| _deserialize(inner_type, v) }
|
300
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
301
|
+
k_type = Regexp.last_match[:k_type]
|
302
|
+
v_type = Regexp.last_match[:v_type]
|
303
|
+
{}.tap do |hash|
|
304
|
+
value.each do |k, v|
|
305
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
306
|
+
end
|
307
|
+
end
|
308
|
+
else # model
|
309
|
+
PulpPythonClient.const_get(type).build_from_hash(value)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
# Returns the string representation of the object
|
314
|
+
# @return [String] String presentation of the object
|
315
|
+
def to_s
|
316
|
+
to_hash.to_s
|
317
|
+
end
|
318
|
+
|
319
|
+
# to_body is an alias to to_hash (backward compatibility)
|
320
|
+
# @return [Hash] Returns the object in the form of hash
|
321
|
+
def to_body
|
322
|
+
to_hash
|
323
|
+
end
|
324
|
+
|
325
|
+
# Returns the object in the form of hash
|
326
|
+
# @return [Hash] Returns the object in the form of hash
|
327
|
+
def to_hash
|
328
|
+
hash = {}
|
329
|
+
self.class.attribute_map.each_pair do |attr, param|
|
330
|
+
value = self.send(attr)
|
331
|
+
if value.nil?
|
332
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
333
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
334
|
+
end
|
335
|
+
|
336
|
+
hash[param] = _to_hash(value)
|
337
|
+
end
|
338
|
+
hash
|
339
|
+
end
|
340
|
+
|
341
|
+
# Outputs non-array value in the form of hash
|
342
|
+
# For object, use to_hash. Otherwise, just return the value
|
343
|
+
# @param [Object] value Any valid value
|
344
|
+
# @return [Hash] Returns the value in the form of hash
|
345
|
+
def _to_hash(value)
|
346
|
+
if value.is_a?(Array)
|
347
|
+
value.compact.map { |v| _to_hash(v) }
|
348
|
+
elsif value.is_a?(Hash)
|
349
|
+
{}.tap do |hash|
|
350
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
351
|
+
end
|
352
|
+
elsif value.respond_to? :to_hash
|
353
|
+
value.to_hash
|
354
|
+
else
|
355
|
+
value
|
356
|
+
end
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|