pulp_file_client 1.8.2 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -15
  3. data/docs/AcsFileApi.md +416 -0
  4. data/docs/ContentFilesApi.md +1 -1
  5. data/docs/DistributionsFileApi.md +1 -1
  6. data/docs/FileFileAlternateContentSource.md +23 -0
  7. data/docs/FileFileAlternateContentSourceResponse.md +27 -0
  8. data/docs/FileFileRepository.md +3 -3
  9. data/docs/FileFileRepositoryResponse.md +3 -3
  10. data/docs/PaginatedfileFileAlternateContentSourceResponseList.md +23 -0
  11. data/docs/PatchedfileFileAlternateContentSource.md +23 -0
  12. data/docs/PatchedfileFileRepository.md +3 -3
  13. data/docs/PublicationsFileApi.md +1 -1
  14. data/docs/RemotesFileApi.md +1 -1
  15. data/docs/RepositoriesFileApi.md +1 -1
  16. data/docs/RepositoriesFileVersionsApi.md +1 -1
  17. data/lib/pulp_file_client/api/acs_file_api.rb +508 -0
  18. data/lib/pulp_file_client/configuration.rb +2 -2
  19. data/lib/pulp_file_client/models/file_file_alternate_content_source.rb +251 -0
  20. data/lib/pulp_file_client/models/file_file_alternate_content_source_response.rb +270 -0
  21. data/lib/pulp_file_client/models/file_file_repository.rb +17 -16
  22. data/lib/pulp_file_client/models/file_file_repository_response.rb +17 -16
  23. data/lib/pulp_file_client/models/paginatedfile_file_alternate_content_source_response_list.rb +237 -0
  24. data/lib/pulp_file_client/models/patchedfile_file_alternate_content_source.rb +241 -0
  25. data/lib/pulp_file_client/models/patchedfile_file_repository.rb +17 -16
  26. data/lib/pulp_file_client/version.rb +1 -1
  27. data/lib/pulp_file_client.rb +5 -0
  28. data/spec/api/acs_file_api_spec.rb +132 -0
  29. data/spec/configuration_spec.rb +3 -3
  30. data/spec/models/file_file_alternate_content_source_response_spec.rb +71 -0
  31. data/spec/models/file_file_alternate_content_source_spec.rb +59 -0
  32. data/spec/models/file_file_repository_response_spec.rb +1 -1
  33. data/spec/models/file_file_repository_spec.rb +1 -1
  34. data/spec/models/paginatedfile_file_alternate_content_source_response_list_spec.rb +59 -0
  35. data/spec/models/patchedfile_file_alternate_content_source_spec.rb +59 -0
  36. data/spec/models/patchedfile_file_repository_spec.rb +1 -1
  37. metadata +45 -25
@@ -127,7 +127,7 @@ module PulpFileClient
127
127
  attr_accessor :force_ending_format
128
128
 
129
129
  def initialize
130
- @scheme = 'http'
130
+ @scheme = 'https'
131
131
  @host = 'pulp'
132
132
  @base_path = ''
133
133
  @api_key = {}
@@ -209,7 +209,7 @@ module PulpFileClient
209
209
  def server_settings
210
210
  [
211
211
  {
212
- url: "http://pulp/",
212
+ url: "https://pulp/",
213
213
  description: "No description provided",
214
214
  }
215
215
  ]
@@ -0,0 +1,251 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ # Serializer for File alternate content source.
17
+ class FileFileAlternateContentSource
18
+ # Name of Alternate Content Source.
19
+ attr_accessor :name
20
+
21
+ # Date of last refresh of AlternateContentSource.
22
+ attr_accessor :last_refreshed
23
+
24
+ # List of paths that will be appended to the Remote url when searching for content.
25
+ attr_accessor :paths
26
+
27
+ # The remote to provide alternate content source.
28
+ attr_accessor :remote
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'last_refreshed' => :'last_refreshed',
35
+ :'paths' => :'paths',
36
+ :'remote' => :'remote'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'name' => :'String',
44
+ :'last_refreshed' => :'DateTime',
45
+ :'paths' => :'Array<String>',
46
+ :'remote' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'last_refreshed',
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileAlternateContentSource` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileAlternateContentSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'last_refreshed')
77
+ self.last_refreshed = attributes[:'last_refreshed']
78
+ end
79
+
80
+ if attributes.key?(:'paths')
81
+ if (value = attributes[:'paths']).is_a?(Array)
82
+ self.paths = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'remote')
87
+ self.remote = attributes[:'remote']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ if @name.nil?
96
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
97
+ end
98
+
99
+ if @remote.nil?
100
+ invalid_properties.push('invalid value for "remote", remote cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @name.nil?
110
+ return false if @remote.nil?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ name == o.name &&
120
+ last_refreshed == o.last_refreshed &&
121
+ paths == o.paths &&
122
+ remote == o.remote
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [name, last_refreshed, paths, remote].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.openapi_types.each_pair do |key, type|
150
+ if type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :DateTime
171
+ DateTime.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ PulpFileClient.const_get(type).build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+ end
251
+ end
@@ -0,0 +1,270 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ # Serializer for File alternate content source.
17
+ class FileFileAlternateContentSourceResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # Name of Alternate Content Source.
24
+ attr_accessor :name
25
+
26
+ # Date of last refresh of AlternateContentSource.
27
+ attr_accessor :last_refreshed
28
+
29
+ # List of paths that will be appended to the Remote url when searching for content.
30
+ attr_accessor :paths
31
+
32
+ # The remote to provide alternate content source.
33
+ attr_accessor :remote
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'pulp_href' => :'pulp_href',
39
+ :'pulp_created' => :'pulp_created',
40
+ :'name' => :'name',
41
+ :'last_refreshed' => :'last_refreshed',
42
+ :'paths' => :'paths',
43
+ :'remote' => :'remote'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'pulp_href' => :'String',
51
+ :'pulp_created' => :'DateTime',
52
+ :'name' => :'String',
53
+ :'last_refreshed' => :'DateTime',
54
+ :'paths' => :'Array<String>',
55
+ :'remote' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'last_refreshed',
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFileAlternateContentSourceResponse` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFileAlternateContentSourceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'pulp_href')
82
+ self.pulp_href = attributes[:'pulp_href']
83
+ end
84
+
85
+ if attributes.key?(:'pulp_created')
86
+ self.pulp_created = attributes[:'pulp_created']
87
+ end
88
+
89
+ if attributes.key?(:'name')
90
+ self.name = attributes[:'name']
91
+ end
92
+
93
+ if attributes.key?(:'last_refreshed')
94
+ self.last_refreshed = attributes[:'last_refreshed']
95
+ end
96
+
97
+ if attributes.key?(:'paths')
98
+ if (value = attributes[:'paths']).is_a?(Array)
99
+ self.paths = value
100
+ end
101
+ end
102
+
103
+ if attributes.key?(:'remote')
104
+ self.remote = attributes[:'remote']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ if @name.nil?
113
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
114
+ end
115
+
116
+ if @remote.nil?
117
+ invalid_properties.push('invalid value for "remote", remote cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ return false if @name.nil?
127
+ return false if @remote.nil?
128
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ pulp_href == o.pulp_href &&
137
+ pulp_created == o.pulp_created &&
138
+ name == o.name &&
139
+ last_refreshed == o.last_refreshed &&
140
+ paths == o.paths &&
141
+ remote == o.remote
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [pulp_href, pulp_created, name, last_refreshed, paths, remote].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.openapi_types.each_pair do |key, type|
169
+ if type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :DateTime
190
+ DateTime.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ PulpFileClient.const_get(type).build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+ end
270
+ end