pulpcore_client 3.12.2 → 3.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -4
  3. data/docs/ContentSummaryResponse.md +21 -0
  4. data/docs/PaginatedPublicationResponseList.md +23 -0
  5. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  6. data/docs/PublicationResponse.md +23 -0
  7. data/docs/PublicationsApi.md +90 -0
  8. data/docs/PulpExport.md +1 -1
  9. data/docs/RepositoryResponse.md +2 -0
  10. data/docs/RepositoryVersionResponse.md +27 -0
  11. data/docs/RepositoryVersionsApi.md +96 -0
  12. data/docs/WorkerResponse.md +3 -3
  13. data/lib/pulpcore_client/api/publications_api.rb +120 -0
  14. data/lib/pulpcore_client/api/repository_versions_api.rb +130 -0
  15. data/lib/pulpcore_client/models/content_summary_response.rb +246 -0
  16. data/lib/pulpcore_client/models/paginated_publication_response_list.rb +237 -0
  17. data/lib/pulpcore_client/models/paginated_repository_version_response_list.rb +237 -0
  18. data/lib/pulpcore_client/models/publication_response.rb +236 -0
  19. data/lib/pulpcore_client/models/pulp_export.rb +1 -1
  20. data/lib/pulpcore_client/models/repository_response.rb +27 -1
  21. data/lib/pulpcore_client/models/repository_version_response.rb +255 -0
  22. data/lib/pulpcore_client/models/worker_response.rb +10 -10
  23. data/lib/pulpcore_client/version.rb +1 -1
  24. data/lib/pulpcore_client.rb +7 -0
  25. data/spec/api/publications_api_spec.rb +60 -0
  26. data/spec/api/repository_versions_api_spec.rb +63 -0
  27. data/spec/models/content_summary_response_spec.rb +53 -0
  28. data/spec/models/paginated_publication_response_list_spec.rb +59 -0
  29. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  30. data/spec/models/publication_response_spec.rb +59 -0
  31. data/spec/models/repository_response_spec.rb +6 -0
  32. data/spec/models/repository_version_response_spec.rb +71 -0
  33. data/spec/models/worker_response_spec.rb +2 -2
  34. metadata +96 -68
@@ -0,0 +1,237 @@
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 PulpcoreClient
16
+ class PaginatedRepositoryVersionResponseList
17
+ attr_accessor :count
18
+
19
+ attr_accessor :_next
20
+
21
+ attr_accessor :previous
22
+
23
+ attr_accessor :results
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'count' => :'count',
29
+ :'_next' => :'next',
30
+ :'previous' => :'previous',
31
+ :'results' => :'results'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'count' => :'Integer',
39
+ :'_next' => :'String',
40
+ :'previous' => :'String',
41
+ :'results' => :'Array<RepositoryVersionResponse>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'_next',
49
+ :'previous',
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PaginatedRepositoryVersionResponseList` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PaginatedRepositoryVersionResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'count')
69
+ self.count = attributes[:'count']
70
+ end
71
+
72
+ if attributes.key?(:'_next')
73
+ self._next = attributes[:'_next']
74
+ end
75
+
76
+ if attributes.key?(:'previous')
77
+ self.previous = attributes[:'previous']
78
+ end
79
+
80
+ if attributes.key?(:'results')
81
+ if (value = attributes[:'results']).is_a?(Array)
82
+ self.results = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ count == o.count &&
106
+ _next == o._next &&
107
+ previous == o.previous &&
108
+ results == o.results
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [count, _next, previous, results].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ PulpcoreClient.const_get(type).build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,236 @@
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 PulpcoreClient
16
+ # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
17
+ class PublicationResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ attr_accessor :repository_version
24
+
25
+ # A URI of the repository to be published.
26
+ attr_accessor :repository
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'pulp_href' => :'pulp_href',
32
+ :'pulp_created' => :'pulp_created',
33
+ :'repository_version' => :'repository_version',
34
+ :'repository' => :'repository'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'pulp_href' => :'String',
42
+ :'pulp_created' => :'DateTime',
43
+ :'repository_version' => :'String',
44
+ :'repository' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PublicationResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PublicationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'pulp_href')
70
+ self.pulp_href = attributes[:'pulp_href']
71
+ end
72
+
73
+ if attributes.key?(:'pulp_created')
74
+ self.pulp_created = attributes[:'pulp_created']
75
+ end
76
+
77
+ if attributes.key?(:'repository_version')
78
+ self.repository_version = attributes[:'repository_version']
79
+ end
80
+
81
+ if attributes.key?(:'repository')
82
+ self.repository = attributes[:'repository']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ pulp_href == o.pulp_href &&
105
+ pulp_created == o.pulp_created &&
106
+ repository_version == o.repository_version &&
107
+ repository == o.repository
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ def hash
119
+ [pulp_href, pulp_created, repository_version, repository].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def self.build_from_hash(attributes)
126
+ new.build_from_hash(attributes)
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.openapi_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :DateTime
156
+ DateTime.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ PulpcoreClient.const_get(type).build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+ end
236
+ end
@@ -27,7 +27,7 @@ module PulpcoreClient
27
27
  # List of explicit repo-version hrefs to export (replaces current_version).
28
28
  attr_accessor :versions
29
29
 
30
- # Chunk export-tarfile into pieces of chunk_size bytes.Recognizes units of B/KB/MB/GB/TB.
30
+ # Chunk export-tarfile into pieces of chunk_size bytes. Recognizes units of B/KB/MB/GB/TB. A chunk has a maximum size of 1TB.
31
31
  attr_accessor :chunk_size
32
32
 
33
33
  # List of explicit last-exported-repo-version hrefs (replaces last_export).
@@ -32,6 +32,9 @@ module PulpcoreClient
32
32
  # An optional description.
33
33
  attr_accessor :description
34
34
 
35
+ # Retain X versions of the repository. Default is null which retains all versions. This is provided as a tech preview in Pulp 3 and may change in the future.
36
+ attr_accessor :retained_versions
37
+
35
38
  attr_accessor :remote
36
39
 
37
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -44,6 +47,7 @@ module PulpcoreClient
44
47
  :'latest_version_href' => :'latest_version_href',
45
48
  :'name' => :'name',
46
49
  :'description' => :'description',
50
+ :'retained_versions' => :'retained_versions',
47
51
  :'remote' => :'remote'
48
52
  }
49
53
  end
@@ -58,6 +62,7 @@ module PulpcoreClient
58
62
  :'latest_version_href' => :'String',
59
63
  :'name' => :'String',
60
64
  :'description' => :'String',
65
+ :'retained_versions' => :'Integer',
61
66
  :'remote' => :'String'
62
67
  }
63
68
  end
@@ -66,6 +71,7 @@ module PulpcoreClient
66
71
  def self.openapi_nullable
67
72
  Set.new([
68
73
  :'description',
74
+ :'retained_versions',
69
75
  :'remote'
70
76
  ])
71
77
  end
@@ -113,6 +119,10 @@ module PulpcoreClient
113
119
  self.description = attributes[:'description']
114
120
  end
115
121
 
122
+ if attributes.key?(:'retained_versions')
123
+ self.retained_versions = attributes[:'retained_versions']
124
+ end
125
+
116
126
  if attributes.key?(:'remote')
117
127
  self.remote = attributes[:'remote']
118
128
  end
@@ -126,6 +136,10 @@ module PulpcoreClient
126
136
  invalid_properties.push('invalid value for "name", name cannot be nil.')
127
137
  end
128
138
 
139
+ if !@retained_versions.nil? && @retained_versions < 1
140
+ invalid_properties.push('invalid value for "retained_versions", must be greater than or equal to 1.')
141
+ end
142
+
129
143
  invalid_properties
130
144
  end
131
145
 
@@ -133,9 +147,20 @@ module PulpcoreClient
133
147
  # @return true if the model is valid
134
148
  def valid?
135
149
  return false if @name.nil?
150
+ return false if !@retained_versions.nil? && @retained_versions < 1
136
151
  true
137
152
  end
138
153
 
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] retained_versions Value to be assigned
156
+ def retained_versions=(retained_versions)
157
+ if !retained_versions.nil? && retained_versions < 1
158
+ fail ArgumentError, 'invalid value for "retained_versions", must be greater than or equal to 1.'
159
+ end
160
+
161
+ @retained_versions = retained_versions
162
+ end
163
+
139
164
  # Checks equality by comparing each attribute.
140
165
  # @param [Object] Object to be compared
141
166
  def ==(o)
@@ -148,6 +173,7 @@ module PulpcoreClient
148
173
  latest_version_href == o.latest_version_href &&
149
174
  name == o.name &&
150
175
  description == o.description &&
176
+ retained_versions == o.retained_versions &&
151
177
  remote == o.remote
152
178
  end
153
179
 
@@ -160,7 +186,7 @@ module PulpcoreClient
160
186
  # Calculates hash code according to all attributes.
161
187
  # @return [Integer] Hash code
162
188
  def hash
163
- [pulp_href, pulp_created, versions_href, pulp_labels, latest_version_href, name, description, remote].hash
189
+ [pulp_href, pulp_created, versions_href, pulp_labels, latest_version_href, name, description, retained_versions, remote].hash
164
190
  end
165
191
 
166
192
  # Builds the object from hash