pulp_file_client 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -17
  3. data/docs/ContentFilesApi.md +5 -5
  4. data/docs/DistributionsFileApi.md +3 -3
  5. data/docs/{Export.md → ExportRead.md} +4 -4
  6. data/docs/ExportersFileExportsApi.md +16 -16
  7. data/docs/ExportersFilesystemApi.md +52 -52
  8. data/docs/{FileFileContent.md → FileFileContentRead.md} +2 -2
  9. data/docs/FileFileDistributionRead.md +29 -0
  10. data/docs/{FileFileFileSystemExporter.md → FileFileFilesystemExporter.md} +2 -2
  11. data/docs/FileFileFilesystemExporterRead.md +23 -0
  12. data/docs/FileFilePublicationRead.md +27 -0
  13. data/docs/FileFileRemote.md +7 -3
  14. data/docs/FileFileRemoteRead.md +43 -0
  15. data/docs/FileFileRepositoryRead.md +27 -0
  16. data/docs/InlineResponse200.md +1 -1
  17. data/docs/InlineResponse2001.md +1 -1
  18. data/docs/InlineResponse2002.md +1 -1
  19. data/docs/InlineResponse2003.md +1 -1
  20. data/docs/InlineResponse2004.md +1 -1
  21. data/docs/InlineResponse2005.md +1 -1
  22. data/docs/InlineResponse2006.md +1 -1
  23. data/docs/InlineResponse2007.md +1 -1
  24. data/docs/PublicationsFileApi.md +3 -3
  25. data/docs/RemotesFileApi.md +5 -5
  26. data/docs/RepositoriesFileApi.md +10 -10
  27. data/docs/RepositoriesFileVersionsApi.md +3 -3
  28. data/docs/RepositoryVersionRead.md +25 -0
  29. data/lib/pulp_file_client/api/content_files_api.rb +5 -5
  30. data/lib/pulp_file_client/api/distributions_file_api.rb +3 -3
  31. data/lib/pulp_file_client/api/exporters_file_exports_api.rb +27 -27
  32. data/lib/pulp_file_client/api/exporters_filesystem_api.rb +78 -78
  33. data/lib/pulp_file_client/api/publications_file_api.rb +3 -3
  34. data/lib/pulp_file_client/api/remotes_file_api.rb +6 -6
  35. data/lib/pulp_file_client/api/repositories_file_api.rb +15 -15
  36. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +3 -3
  37. data/lib/pulp_file_client/configuration.rb +2 -2
  38. data/lib/pulp_file_client/models/{export.rb → export_read.rb} +4 -13
  39. data/lib/pulp_file_client/models/{file_file_content.rb → file_file_content_read.rb} +3 -3
  40. data/lib/pulp_file_client/models/file_file_distribution_read.rb +331 -0
  41. data/lib/pulp_file_client/models/{file_file_file_system_exporter.rb → file_file_filesystem_exporter.rb} +3 -3
  42. data/lib/pulp_file_client/models/file_file_filesystem_exporter_read.rb +284 -0
  43. data/lib/pulp_file_client/models/file_file_publication_read.rb +274 -0
  44. data/lib/pulp_file_client/models/file_file_remote.rb +56 -4
  45. data/lib/pulp_file_client/models/file_file_remote_read.rb +531 -0
  46. data/lib/pulp_file_client/models/file_file_repository_read.rb +294 -0
  47. data/lib/pulp_file_client/models/inline_response200.rb +1 -1
  48. data/lib/pulp_file_client/models/inline_response2001.rb +1 -1
  49. data/lib/pulp_file_client/models/inline_response2002.rb +1 -1
  50. data/lib/pulp_file_client/models/inline_response2003.rb +1 -1
  51. data/lib/pulp_file_client/models/inline_response2004.rb +1 -1
  52. data/lib/pulp_file_client/models/inline_response2005.rb +1 -1
  53. data/lib/pulp_file_client/models/inline_response2006.rb +1 -1
  54. data/lib/pulp_file_client/models/inline_response2007.rb +1 -1
  55. data/lib/pulp_file_client/models/repository_version_read.rb +244 -0
  56. data/lib/pulp_file_client/version.rb +1 -1
  57. data/lib/pulp_file_client.rb +9 -3
  58. data/spec/api/content_files_api_spec.rb +2 -2
  59. data/spec/api/distributions_file_api_spec.rb +1 -1
  60. data/spec/api/exporters_file_exports_api_spec.rb +6 -6
  61. data/spec/api/exporters_filesystem_api_spec.rb +20 -20
  62. data/spec/api/publications_file_api_spec.rb +1 -1
  63. data/spec/api/remotes_file_api_spec.rb +2 -2
  64. data/spec/api/repositories_file_api_spec.rb +6 -6
  65. data/spec/api/repositories_file_versions_api_spec.rb +1 -1
  66. data/spec/configuration_spec.rb +3 -3
  67. data/spec/models/{export_spec.rb → export_read_spec.rb} +6 -6
  68. data/spec/models/{file_file_content_spec.rb → file_file_content_read_spec.rb} +6 -6
  69. data/spec/models/file_file_distribution_read_spec.rb +77 -0
  70. data/spec/models/file_file_filesystem_exporter_read_spec.rb +59 -0
  71. data/spec/models/{file_file_file_system_exporter_spec.rb → file_file_filesystem_exporter_spec.rb} +6 -6
  72. data/spec/models/file_file_publication_read_spec.rb +71 -0
  73. data/spec/models/file_file_remote_read_spec.rb +123 -0
  74. data/spec/models/file_file_remote_spec.rb +12 -0
  75. data/spec/models/file_file_repository_read_spec.rb +71 -0
  76. data/spec/models/repository_version_read_spec.rb +65 -0
  77. metadata +38 -14
@@ -0,0 +1,284 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ class FileFileFilesystemExporterRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # Unique name of the file system exporter.
23
+ attr_accessor :name
24
+
25
+ # File system location to export to.
26
+ attr_accessor :path
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
+ :'name' => :'name',
34
+ :'path' => :'path'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'pulp_href' => :'String',
42
+ :'pulp_created' => :'DateTime',
43
+ :'name' => :'String',
44
+ :'path' => :'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 `PulpFileClient::FileFileFilesystemExporterRead` 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 `PulpFileClient::FileFileFilesystemExporterRead`. 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?(:'name')
78
+ self.name = attributes[:'name']
79
+ end
80
+
81
+ if attributes.key?(:'path')
82
+ self.path = attributes[:'path']
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
+ if @name.nil?
91
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
92
+ end
93
+
94
+ if @name.to_s.length < 1
95
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
96
+ end
97
+
98
+ if @path.nil?
99
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
100
+ end
101
+
102
+ if @path.to_s.length < 1
103
+ invalid_properties.push('invalid value for "path", the character length must be great than or equal to 1.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @name.nil?
113
+ return false if @name.to_s.length < 1
114
+ return false if @path.nil?
115
+ return false if @path.to_s.length < 1
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] name Value to be assigned
121
+ def name=(name)
122
+ if name.nil?
123
+ fail ArgumentError, 'name cannot be nil'
124
+ end
125
+
126
+ if name.to_s.length < 1
127
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
128
+ end
129
+
130
+ @name = name
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] path Value to be assigned
135
+ def path=(path)
136
+ if path.nil?
137
+ fail ArgumentError, 'path cannot be nil'
138
+ end
139
+
140
+ if path.to_s.length < 1
141
+ fail ArgumentError, 'invalid value for "path", the character length must be great than or equal to 1.'
142
+ end
143
+
144
+ @path = path
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ pulp_href == o.pulp_href &&
153
+ pulp_created == o.pulp_created &&
154
+ name == o.name &&
155
+ path == o.path
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [pulp_href, pulp_created, name, path].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ new.build_from_hash(attributes)
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.openapi_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ PulpFileClient.const_get(type).build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+ end
284
+ end
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ class FileFilePublicationRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ attr_accessor :repository_version
23
+
24
+ # A URI of the repository to be published.
25
+ attr_accessor :repository
26
+
27
+ # This publication is currently hosted as defined by these distributions.
28
+ attr_accessor :distributions
29
+
30
+ # Filename to use for manifest file containing metadata for all the files.
31
+ attr_accessor :manifest
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'pulp_href' => :'pulp_href',
37
+ :'pulp_created' => :'pulp_created',
38
+ :'repository_version' => :'repository_version',
39
+ :'repository' => :'repository',
40
+ :'distributions' => :'distributions',
41
+ :'manifest' => :'manifest'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'pulp_href' => :'String',
49
+ :'pulp_created' => :'DateTime',
50
+ :'repository_version' => :'String',
51
+ :'repository' => :'String',
52
+ :'distributions' => :'Array<String>',
53
+ :'manifest' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::FileFilePublicationRead` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::FileFilePublicationRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'pulp_href')
79
+ self.pulp_href = attributes[:'pulp_href']
80
+ end
81
+
82
+ if attributes.key?(:'pulp_created')
83
+ self.pulp_created = attributes[:'pulp_created']
84
+ end
85
+
86
+ if attributes.key?(:'repository_version')
87
+ self.repository_version = attributes[:'repository_version']
88
+ end
89
+
90
+ if attributes.key?(:'repository')
91
+ self.repository = attributes[:'repository']
92
+ end
93
+
94
+ if attributes.key?(:'distributions')
95
+ if (value = attributes[:'distributions']).is_a?(Array)
96
+ self.distributions = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'manifest')
101
+ self.manifest = attributes[:'manifest']
102
+ else
103
+ self.manifest = 'PULP_MANIFEST'
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ if !@manifest.nil? && @manifest.to_s.length < 1
112
+ invalid_properties.push('invalid value for "manifest", the character length must be great than or equal to 1.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ return false if !@manifest.nil? && @manifest.to_s.length < 1
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] manifest Value to be assigned
127
+ def manifest=(manifest)
128
+ if !manifest.nil? && manifest.to_s.length < 1
129
+ fail ArgumentError, 'invalid value for "manifest", the character length must be great than or equal to 1.'
130
+ end
131
+
132
+ @manifest = manifest
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ pulp_href == o.pulp_href &&
141
+ pulp_created == o.pulp_created &&
142
+ repository_version == o.repository_version &&
143
+ repository == o.repository &&
144
+ distributions == o.distributions &&
145
+ manifest == o.manifest
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [pulp_href, pulp_created, repository_version, repository, distributions, manifest].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ new.build_from_hash(attributes)
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :DateTime
194
+ DateTime.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :Boolean
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ PulpFileClient.const_get(type).build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ if value.nil?
247
+ is_nullable = self.class.openapi_nullable.include?(attr)
248
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
+ end
250
+
251
+ hash[param] = _to_hash(value)
252
+ end
253
+ hash
254
+ end
255
+
256
+ # Outputs non-array value in the form of hash
257
+ # For object, use to_hash. Otherwise, just return the value
258
+ # @param [Object] value Any valid value
259
+ # @return [Hash] Returns the value in the form of hash
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map { |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+ end
274
+ end
@@ -25,13 +25,13 @@ module PulpFileClient
25
25
  # The URL of an external content source.
26
26
  attr_accessor :url
27
27
 
28
- # 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 checksum of the certificate file on GET.
28
+ # 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.
29
29
  attr_accessor :ca_cert
30
30
 
31
- # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 checksum of the certificate file on GET.
31
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped.
32
32
  attr_accessor :client_cert
33
33
 
34
- # A PEM encoded private key used for authentication. Returns SHA256 checksum of the certificate file on GET.
34
+ # A PEM encoded private key used for authentication.
35
35
  attr_accessor :client_key
36
36
 
37
37
  # If True, TLS peer validation must be performed.
@@ -40,6 +40,12 @@ module PulpFileClient
40
40
  # The proxy URL. Format: scheme://user:password@host:port
41
41
  attr_accessor :proxy_url
42
42
 
43
+ # The username to be used for authentication when syncing.
44
+ attr_accessor :username
45
+
46
+ # The password to be used for authentication when syncing.
47
+ attr_accessor :password
48
+
43
49
  # Timestamp of the most recent update of the remote.
44
50
  attr_accessor :pulp_last_updated
45
51
 
@@ -83,6 +89,8 @@ module PulpFileClient
83
89
  :'client_key' => :'client_key',
84
90
  :'tls_validation' => :'tls_validation',
85
91
  :'proxy_url' => :'proxy_url',
92
+ :'username' => :'username',
93
+ :'password' => :'password',
86
94
  :'pulp_last_updated' => :'pulp_last_updated',
87
95
  :'download_concurrency' => :'download_concurrency',
88
96
  :'policy' => :'policy'
@@ -101,6 +109,8 @@ module PulpFileClient
101
109
  :'client_key' => :'String',
102
110
  :'tls_validation' => :'Boolean',
103
111
  :'proxy_url' => :'String',
112
+ :'username' => :'String',
113
+ :'password' => :'String',
104
114
  :'pulp_last_updated' => :'DateTime',
105
115
  :'download_concurrency' => :'Integer',
106
116
  :'policy' => :'String'
@@ -114,6 +124,8 @@ module PulpFileClient
114
124
  :'client_cert',
115
125
  :'client_key',
116
126
  :'proxy_url',
127
+ :'username',
128
+ :'password',
117
129
  ])
118
130
  end
119
131
 
@@ -168,6 +180,14 @@ module PulpFileClient
168
180
  self.proxy_url = attributes[:'proxy_url']
169
181
  end
170
182
 
183
+ if attributes.key?(:'username')
184
+ self.username = attributes[:'username']
185
+ end
186
+
187
+ if attributes.key?(:'password')
188
+ self.password = attributes[:'password']
189
+ end
190
+
171
191
  if attributes.key?(:'pulp_last_updated')
172
192
  self.pulp_last_updated = attributes[:'pulp_last_updated']
173
193
  end
@@ -219,6 +239,14 @@ module PulpFileClient
219
239
  invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
220
240
  end
221
241
 
242
+ if !@username.nil? && @username.to_s.length < 1
243
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
244
+ end
245
+
246
+ if !@password.nil? && @password.to_s.length < 1
247
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
248
+ end
249
+
222
250
  if !@download_concurrency.nil? && @download_concurrency < 1
223
251
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
224
252
  end
@@ -237,6 +265,8 @@ module PulpFileClient
237
265
  return false if !@client_cert.nil? && @client_cert.to_s.length < 1
238
266
  return false if !@client_key.nil? && @client_key.to_s.length < 1
239
267
  return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
268
+ return false if !@username.nil? && @username.to_s.length < 1
269
+ return false if !@password.nil? && @password.to_s.length < 1
240
270
  return false if !@download_concurrency.nil? && @download_concurrency < 1
241
271
  policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
242
272
  return false unless policy_validator.valid?(@policy)
@@ -311,6 +341,26 @@ module PulpFileClient
311
341
  @proxy_url = proxy_url
312
342
  end
313
343
 
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] username Value to be assigned
346
+ def username=(username)
347
+ if !username.nil? && username.to_s.length < 1
348
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
349
+ end
350
+
351
+ @username = username
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] password Value to be assigned
356
+ def password=(password)
357
+ if !password.nil? && password.to_s.length < 1
358
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
359
+ end
360
+
361
+ @password = password
362
+ end
363
+
314
364
  # Custom attribute writer method with validation
315
365
  # @param [Object] download_concurrency Value to be assigned
316
366
  def download_concurrency=(download_concurrency)
@@ -345,6 +395,8 @@ module PulpFileClient
345
395
  client_key == o.client_key &&
346
396
  tls_validation == o.tls_validation &&
347
397
  proxy_url == o.proxy_url &&
398
+ username == o.username &&
399
+ password == o.password &&
348
400
  pulp_last_updated == o.pulp_last_updated &&
349
401
  download_concurrency == o.download_concurrency &&
350
402
  policy == o.policy
@@ -359,7 +411,7 @@ module PulpFileClient
359
411
  # Calculates hash code according to all attributes.
360
412
  # @return [Integer] Hash code
361
413
  def hash
362
- [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, pulp_last_updated, download_concurrency, policy].hash
414
+ [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
363
415
  end
364
416
 
365
417
  # Builds the object from hash