pulp_ansible_client 0.5.4 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -4
  3. data/docs/AnsibleCollectionRemote.md +8 -0
  4. data/docs/AnsibleCollectionRemoteResponse.md +8 -0
  5. data/docs/AnsibleCollectionVersionResponse.md +3 -3
  6. data/docs/AnsibleRoleRemote.md +9 -1
  7. data/docs/AnsibleRoleRemoteResponse.md +9 -1
  8. data/docs/AnsibleRoleResponse.md +3 -3
  9. data/docs/ArtifactRefResponse.md +21 -0
  10. data/docs/CollectionResponse.md +2 -2
  11. data/docs/CollectionVersionResponse.md +1 -1
  12. data/docs/PaginatedCollectionResponseList.md +2 -2
  13. data/docs/PaginatedCollectionResponseListLinks.md +23 -0
  14. data/docs/PaginatedCollectionResponseListMeta.md +17 -0
  15. data/docs/PaginatedCollectionVersionResponseList.md +2 -2
  16. data/docs/PatchedansibleCollectionRemote.md +8 -0
  17. data/docs/PatchedansibleRoleRemote.md +9 -1
  18. data/docs/RepositoriesAnsibleVersionsApi.md +2 -2
  19. data/lib/pulp_ansible_client.rb +3 -0
  20. data/lib/pulp_ansible_client/api/repositories_ansible_versions_api.rb +4 -4
  21. data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +105 -1
  22. data/lib/pulp_ansible_client/models/ansible_collection_remote_response.rb +105 -1
  23. data/lib/pulp_ansible_client/models/ansible_collection_version.rb +15 -15
  24. data/lib/pulp_ansible_client/models/ansible_collection_version_response.rb +25 -25
  25. data/lib/pulp_ansible_client/models/ansible_role_remote.rb +108 -4
  26. data/lib/pulp_ansible_client/models/ansible_role_remote_response.rb +108 -4
  27. data/lib/pulp_ansible_client/models/ansible_role_response.rb +10 -10
  28. data/lib/pulp_ansible_client/models/artifact_ref_response.rb +240 -0
  29. data/lib/pulp_ansible_client/models/collection_response.rb +2 -2
  30. data/lib/pulp_ansible_client/models/collection_version_response.rb +1 -1
  31. data/lib/pulp_ansible_client/models/paginated_collection_response_list.rb +2 -2
  32. data/lib/pulp_ansible_client/models/paginated_collection_response_list_links.rb +237 -0
  33. data/lib/pulp_ansible_client/models/paginated_collection_response_list_meta.rb +206 -0
  34. data/lib/pulp_ansible_client/models/paginated_collection_version_response_list.rb +2 -2
  35. data/lib/pulp_ansible_client/models/patchedansible_collection_remote.rb +105 -1
  36. data/lib/pulp_ansible_client/models/patchedansible_role_remote.rb +108 -4
  37. data/lib/pulp_ansible_client/version.rb +1 -1
  38. data/spec/api/repositories_ansible_versions_api_spec.rb +2 -2
  39. data/spec/models/ansible_collection_remote_response_spec.rb +24 -0
  40. data/spec/models/ansible_collection_remote_spec.rb +24 -0
  41. data/spec/models/ansible_collection_version_response_spec.rb +2 -2
  42. data/spec/models/ansible_role_remote_response_spec.rb +24 -0
  43. data/spec/models/ansible_role_remote_spec.rb +24 -0
  44. data/spec/models/ansible_role_response_spec.rb +2 -2
  45. data/spec/models/artifact_ref_response_spec.rb +53 -0
  46. data/spec/models/paginated_collection_response_list_links_spec.rb +59 -0
  47. data/spec/models/paginated_collection_response_list_meta_spec.rb +41 -0
  48. data/spec/models/patchedansible_collection_remote_spec.rb +24 -0
  49. data/spec/models/patchedansible_role_remote_spec.rb +24 -0
  50. metadata +76 -64
@@ -56,6 +56,18 @@ module PulpAnsibleClient
56
56
  # The policy to use when downloading content.
57
57
  attr_accessor :policy
58
58
 
59
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections.
60
+ attr_accessor :total_timeout
61
+
62
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections.
63
+ attr_accessor :connect_timeout
64
+
65
+ # aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections.
66
+ attr_accessor :sock_connect_timeout
67
+
68
+ # aiohttp.ClientTimeout.sock_read (q.v.) for download-connections.
69
+ attr_accessor :sock_read_timeout
70
+
59
71
  # Attribute mapping from ruby-style variable name to JSON key.
60
72
  def self.attribute_map
61
73
  {
@@ -72,7 +84,11 @@ module PulpAnsibleClient
72
84
  :'password' => :'password',
73
85
  :'pulp_last_updated' => :'pulp_last_updated',
74
86
  :'download_concurrency' => :'download_concurrency',
75
- :'policy' => :'policy'
87
+ :'policy' => :'policy',
88
+ :'total_timeout' => :'total_timeout',
89
+ :'connect_timeout' => :'connect_timeout',
90
+ :'sock_connect_timeout' => :'sock_connect_timeout',
91
+ :'sock_read_timeout' => :'sock_read_timeout'
76
92
  }
77
93
  end
78
94
 
@@ -92,7 +108,11 @@ module PulpAnsibleClient
92
108
  :'password' => :'String',
93
109
  :'pulp_last_updated' => :'DateTime',
94
110
  :'download_concurrency' => :'Integer',
95
- :'policy' => :'PolicyEnum'
111
+ :'policy' => :'PolicyEnum',
112
+ :'total_timeout' => :'Float',
113
+ :'connect_timeout' => :'Float',
114
+ :'sock_connect_timeout' => :'Float',
115
+ :'sock_read_timeout' => :'Float'
96
116
  }
97
117
  end
98
118
 
@@ -105,6 +125,10 @@ module PulpAnsibleClient
105
125
  :'proxy_url',
106
126
  :'username',
107
127
  :'password',
128
+ :'total_timeout',
129
+ :'connect_timeout',
130
+ :'sock_connect_timeout',
131
+ :'sock_read_timeout'
108
132
  ])
109
133
  end
110
134
 
@@ -178,6 +202,22 @@ module PulpAnsibleClient
178
202
  if attributes.key?(:'policy')
179
203
  self.policy = attributes[:'policy']
180
204
  end
205
+
206
+ if attributes.key?(:'total_timeout')
207
+ self.total_timeout = attributes[:'total_timeout']
208
+ end
209
+
210
+ if attributes.key?(:'connect_timeout')
211
+ self.connect_timeout = attributes[:'connect_timeout']
212
+ end
213
+
214
+ if attributes.key?(:'sock_connect_timeout')
215
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
216
+ end
217
+
218
+ if attributes.key?(:'sock_read_timeout')
219
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
220
+ end
181
221
  end
182
222
 
183
223
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -196,6 +236,22 @@ module PulpAnsibleClient
196
236
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
197
237
  end
198
238
 
239
+ if !@total_timeout.nil? && @total_timeout < 0.0
240
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
241
+ end
242
+
243
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
244
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
245
+ end
246
+
247
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
248
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
249
+ end
250
+
251
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
252
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
253
+ end
254
+
199
255
  invalid_properties
200
256
  end
201
257
 
@@ -205,6 +261,10 @@ module PulpAnsibleClient
205
261
  return false if @name.nil?
206
262
  return false if @url.nil?
207
263
  return false if !@download_concurrency.nil? && @download_concurrency < 1
264
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
265
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
266
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
267
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
208
268
  true
209
269
  end
210
270
 
@@ -218,6 +278,46 @@ module PulpAnsibleClient
218
278
  @download_concurrency = download_concurrency
219
279
  end
220
280
 
281
+ # Custom attribute writer method with validation
282
+ # @param [Object] total_timeout Value to be assigned
283
+ def total_timeout=(total_timeout)
284
+ if !total_timeout.nil? && total_timeout < 0.0
285
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
286
+ end
287
+
288
+ @total_timeout = total_timeout
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] connect_timeout Value to be assigned
293
+ def connect_timeout=(connect_timeout)
294
+ if !connect_timeout.nil? && connect_timeout < 0.0
295
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
296
+ end
297
+
298
+ @connect_timeout = connect_timeout
299
+ end
300
+
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] sock_connect_timeout Value to be assigned
303
+ def sock_connect_timeout=(sock_connect_timeout)
304
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
305
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
306
+ end
307
+
308
+ @sock_connect_timeout = sock_connect_timeout
309
+ end
310
+
311
+ # Custom attribute writer method with validation
312
+ # @param [Object] sock_read_timeout Value to be assigned
313
+ def sock_read_timeout=(sock_read_timeout)
314
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
315
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
316
+ end
317
+
318
+ @sock_read_timeout = sock_read_timeout
319
+ end
320
+
221
321
  # Checks equality by comparing each attribute.
222
322
  # @param [Object] Object to be compared
223
323
  def ==(o)
@@ -236,7 +336,11 @@ module PulpAnsibleClient
236
336
  password == o.password &&
237
337
  pulp_last_updated == o.pulp_last_updated &&
238
338
  download_concurrency == o.download_concurrency &&
239
- policy == o.policy
339
+ policy == o.policy &&
340
+ total_timeout == o.total_timeout &&
341
+ connect_timeout == o.connect_timeout &&
342
+ sock_connect_timeout == o.sock_connect_timeout &&
343
+ sock_read_timeout == o.sock_read_timeout
240
344
  end
241
345
 
242
346
  # @see the `==` method
@@ -248,7 +352,7 @@ module PulpAnsibleClient
248
352
  # Calculates hash code according to all attributes.
249
353
  # @return [Integer] Hash code
250
354
  def hash
251
- [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy].hash
355
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout].hash
252
356
  end
253
357
 
254
358
  # Builds the object from hash
@@ -15,11 +15,11 @@ require 'date'
15
15
  module PulpAnsibleClient
16
16
  # A serializer for Role versions.
17
17
  class AnsibleRoleResponse
18
+ attr_accessor :pulp_href
19
+
18
20
  # Artifact file representing the physical content
19
21
  attr_accessor :artifact
20
22
 
21
- attr_accessor :pulp_href
22
-
23
23
  # Timestamp of creation.
24
24
  attr_accessor :pulp_created
25
25
 
@@ -32,8 +32,8 @@ module PulpAnsibleClient
32
32
  # Attribute mapping from ruby-style variable name to JSON key.
33
33
  def self.attribute_map
34
34
  {
35
- :'artifact' => :'artifact',
36
35
  :'pulp_href' => :'pulp_href',
36
+ :'artifact' => :'artifact',
37
37
  :'pulp_created' => :'pulp_created',
38
38
  :'version' => :'version',
39
39
  :'name' => :'name',
@@ -44,8 +44,8 @@ module PulpAnsibleClient
44
44
  # Attribute type mapping.
45
45
  def self.openapi_types
46
46
  {
47
- :'artifact' => :'String',
48
47
  :'pulp_href' => :'String',
48
+ :'artifact' => :'String',
49
49
  :'pulp_created' => :'DateTime',
50
50
  :'version' => :'String',
51
51
  :'name' => :'String',
@@ -74,14 +74,14 @@ module PulpAnsibleClient
74
74
  h[k.to_sym] = v
75
75
  }
76
76
 
77
- if attributes.key?(:'artifact')
78
- self.artifact = attributes[:'artifact']
79
- end
80
-
81
77
  if attributes.key?(:'pulp_href')
82
78
  self.pulp_href = attributes[:'pulp_href']
83
79
  end
84
80
 
81
+ if attributes.key?(:'artifact')
82
+ self.artifact = attributes[:'artifact']
83
+ end
84
+
85
85
  if attributes.key?(:'pulp_created')
86
86
  self.pulp_created = attributes[:'pulp_created']
87
87
  end
@@ -137,8 +137,8 @@ module PulpAnsibleClient
137
137
  def ==(o)
138
138
  return true if self.equal?(o)
139
139
  self.class == o.class &&
140
- artifact == o.artifact &&
141
140
  pulp_href == o.pulp_href &&
141
+ artifact == o.artifact &&
142
142
  pulp_created == o.pulp_created &&
143
143
  version == o.version &&
144
144
  name == o.name &&
@@ -154,7 +154,7 @@ module PulpAnsibleClient
154
154
  # Calculates hash code according to all attributes.
155
155
  # @return [Integer] Hash code
156
156
  def hash
157
- [artifact, pulp_href, pulp_created, version, name, namespace].hash
157
+ [pulp_href, artifact, pulp_created, version, name, namespace].hash
158
158
  end
159
159
 
160
160
  # Builds the object from hash
@@ -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 PulpAnsibleClient
16
+ # A serializer for an Artifact reference.
17
+ class ArtifactRefResponse
18
+ attr_accessor :filename
19
+
20
+ attr_accessor :sha256
21
+
22
+ attr_accessor :size
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'filename' => :'filename',
28
+ :'sha256' => :'sha256',
29
+ :'size' => :'size'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'filename' => :'String',
37
+ :'sha256' => :'String',
38
+ :'size' => :'Integer'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::ArtifactRefResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::ArtifactRefResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'filename')
64
+ self.filename = attributes[:'filename']
65
+ end
66
+
67
+ if attributes.key?(:'sha256')
68
+ self.sha256 = attributes[:'sha256']
69
+ end
70
+
71
+ if attributes.key?(:'size')
72
+ self.size = attributes[:'size']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ if @filename.nil?
81
+ invalid_properties.push('invalid value for "filename", filename cannot be nil.')
82
+ end
83
+
84
+ if @sha256.nil?
85
+ invalid_properties.push('invalid value for "sha256", sha256 cannot be nil.')
86
+ end
87
+
88
+ if @size.nil?
89
+ invalid_properties.push('invalid value for "size", size cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if @filename.nil?
99
+ return false if @sha256.nil?
100
+ return false if @size.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ filename == o.filename &&
110
+ sha256 == o.sha256 &&
111
+ size == o.size
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
+ [filename, sha256, size].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
+ PulpAnsibleClient.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