pulp_container_client 1.0.0rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +164 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContainerBlob.md +25 -0
  7. data/docs/ContainerContainerDistribution.md +31 -0
  8. data/docs/ContainerContainerRemote.md +43 -0
  9. data/docs/ContainerContainerRepository.md +27 -0
  10. data/docs/ContainerManifest.md +33 -0
  11. data/docs/ContainerTag.md +25 -0
  12. data/docs/ContentBlobsApi.md +142 -0
  13. data/docs/ContentManifestsApi.md +142 -0
  14. data/docs/ContentSummary.md +21 -0
  15. data/docs/ContentTagsApi.md +144 -0
  16. data/docs/DistributionsContainerApi.md +362 -0
  17. data/docs/InlineResponse200.md +23 -0
  18. data/docs/InlineResponse2001.md +23 -0
  19. data/docs/InlineResponse2002.md +23 -0
  20. data/docs/InlineResponse2003.md +23 -0
  21. data/docs/InlineResponse2004.md +23 -0
  22. data/docs/InlineResponse2005.md +23 -0
  23. data/docs/InlineResponse2006.md +23 -0
  24. data/docs/ManifestCopy.md +23 -0
  25. data/docs/RecursiveManage.md +17 -0
  26. data/docs/RemotesContainerApi.md +366 -0
  27. data/docs/RepositoriesContainerApi.md +739 -0
  28. data/docs/RepositoriesContainerVersionsApi.md +214 -0
  29. data/docs/RepositorySyncURL.md +19 -0
  30. data/docs/RepositoryVersion.md +25 -0
  31. data/docs/TagCopy.md +21 -0
  32. data/docs/TagImage.md +19 -0
  33. data/docs/UnTagImage.md +17 -0
  34. data/git_push.sh +58 -0
  35. data/lib/pulp_container_client/api/content_blobs_api.rb +176 -0
  36. data/lib/pulp_container_client/api/content_manifests_api.rb +176 -0
  37. data/lib/pulp_container_client/api/content_tags_api.rb +179 -0
  38. data/lib/pulp_container_client/api/distributions_container_api.rb +442 -0
  39. data/lib/pulp_container_client/api/remotes_container_api.rb +448 -0
  40. data/lib/pulp_container_client/api/repositories_container_api.rb +906 -0
  41. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +268 -0
  42. data/lib/pulp_container_client/api_client.rb +402 -0
  43. data/lib/pulp_container_client/api_error.rb +57 -0
  44. data/lib/pulp_container_client/configuration.rb +243 -0
  45. data/lib/pulp_container_client/models/async_operation_response.rb +212 -0
  46. data/lib/pulp_container_client/models/container_blob.rb +299 -0
  47. data/lib/pulp_container_client/models/container_container_distribution.rb +342 -0
  48. data/lib/pulp_container_client/models/container_container_remote.rb +526 -0
  49. data/lib/pulp_container_client/models/container_container_repository.rb +294 -0
  50. data/lib/pulp_container_client/models/container_manifest.rb +363 -0
  51. data/lib/pulp_container_client/models/container_tag.rb +280 -0
  52. data/lib/pulp_container_client/models/content_summary.rb +246 -0
  53. data/lib/pulp_container_client/models/inline_response200.rb +247 -0
  54. data/lib/pulp_container_client/models/inline_response2001.rb +247 -0
  55. data/lib/pulp_container_client/models/inline_response2002.rb +247 -0
  56. data/lib/pulp_container_client/models/inline_response2003.rb +247 -0
  57. data/lib/pulp_container_client/models/inline_response2004.rb +247 -0
  58. data/lib/pulp_container_client/models/inline_response2005.rb +247 -0
  59. data/lib/pulp_container_client/models/inline_response2006.rb +247 -0
  60. data/lib/pulp_container_client/models/manifest_copy.rb +263 -0
  61. data/lib/pulp_container_client/models/recursive_manage.rb +209 -0
  62. data/lib/pulp_container_client/models/repository_sync_url.rb +224 -0
  63. data/lib/pulp_container_client/models/repository_version.rb +244 -0
  64. data/lib/pulp_container_client/models/tag_copy.rb +229 -0
  65. data/lib/pulp_container_client/models/tag_image.rb +265 -0
  66. data/lib/pulp_container_client/models/un_tag_image.rb +231 -0
  67. data/lib/pulp_container_client/version.rb +15 -0
  68. data/lib/pulp_container_client.rb +68 -0
  69. data/pulp_container_client.gemspec +39 -0
  70. data/spec/api/content_blobs_api_spec.rb +70 -0
  71. data/spec/api/content_manifests_api_spec.rb +70 -0
  72. data/spec/api/content_tags_api_spec.rb +71 -0
  73. data/spec/api/distributions_container_api_spec.rb +120 -0
  74. data/spec/api/remotes_container_api_spec.rb +122 -0
  75. data/spec/api/repositories_container_api_spec.rb +200 -0
  76. data/spec/api/repositories_container_versions_api_spec.rb +91 -0
  77. data/spec/api_client_spec.rb +188 -0
  78. data/spec/configuration_spec.rb +42 -0
  79. data/spec/models/async_operation_response_spec.rb +41 -0
  80. data/spec/models/container_blob_spec.rb +65 -0
  81. data/spec/models/container_container_distribution_spec.rb +83 -0
  82. data/spec/models/container_container_remote_spec.rb +123 -0
  83. data/spec/models/container_container_repository_spec.rb +71 -0
  84. data/spec/models/container_manifest_spec.rb +89 -0
  85. data/spec/models/container_tag_spec.rb +65 -0
  86. data/spec/models/content_summary_spec.rb +53 -0
  87. data/spec/models/inline_response2001_spec.rb +59 -0
  88. data/spec/models/inline_response2002_spec.rb +59 -0
  89. data/spec/models/inline_response2003_spec.rb +59 -0
  90. data/spec/models/inline_response2004_spec.rb +59 -0
  91. data/spec/models/inline_response2005_spec.rb +59 -0
  92. data/spec/models/inline_response2006_spec.rb +59 -0
  93. data/spec/models/inline_response200_spec.rb +59 -0
  94. data/spec/models/manifest_copy_spec.rb +63 -0
  95. data/spec/models/recursive_manage_spec.rb +41 -0
  96. data/spec/models/repository_sync_url_spec.rb +47 -0
  97. data/spec/models/repository_version_spec.rb +65 -0
  98. data/spec/models/tag_copy_spec.rb +53 -0
  99. data/spec/models/tag_image_spec.rb +47 -0
  100. data/spec/models/un_tag_image_spec.rb +41 -0
  101. data/spec/spec_helper.rb +111 -0
  102. metadata +230 -0
@@ -0,0 +1,299 @@
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.2-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ class ContainerBlob
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # Artifact file representing the physical content
23
+ attr_accessor :artifact
24
+
25
+ # sha256 of the Blob file
26
+ attr_accessor :digest
27
+
28
+ # Blob media type of the file
29
+ attr_accessor :media_type
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'pulp_href' => :'pulp_href',
35
+ :'pulp_created' => :'pulp_created',
36
+ :'artifact' => :'artifact',
37
+ :'digest' => :'digest',
38
+ :'media_type' => :'media_type'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'pulp_href' => :'String',
46
+ :'pulp_created' => :'DateTime',
47
+ :'artifact' => :'String',
48
+ :'digest' => :'String',
49
+ :'media_type' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerBlob` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerBlob`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'pulp_href')
75
+ self.pulp_href = attributes[:'pulp_href']
76
+ end
77
+
78
+ if attributes.key?(:'pulp_created')
79
+ self.pulp_created = attributes[:'pulp_created']
80
+ end
81
+
82
+ if attributes.key?(:'artifact')
83
+ self.artifact = attributes[:'artifact']
84
+ end
85
+
86
+ if attributes.key?(:'digest')
87
+ self.digest = attributes[:'digest']
88
+ end
89
+
90
+ if attributes.key?(:'media_type')
91
+ self.media_type = attributes[:'media_type']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @artifact.nil?
100
+ invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
101
+ end
102
+
103
+ if @digest.nil?
104
+ invalid_properties.push('invalid value for "digest", digest cannot be nil.')
105
+ end
106
+
107
+ if @digest.to_s.length < 1
108
+ invalid_properties.push('invalid value for "digest", the character length must be great than or equal to 1.')
109
+ end
110
+
111
+ if @media_type.nil?
112
+ invalid_properties.push('invalid value for "media_type", media_type cannot be nil.')
113
+ end
114
+
115
+ if @media_type.to_s.length < 1
116
+ invalid_properties.push('invalid value for "media_type", the character length must be great than or equal to 1.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ return false if @artifact.nil?
126
+ return false if @digest.nil?
127
+ return false if @digest.to_s.length < 1
128
+ return false if @media_type.nil?
129
+ return false if @media_type.to_s.length < 1
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] digest Value to be assigned
135
+ def digest=(digest)
136
+ if digest.nil?
137
+ fail ArgumentError, 'digest cannot be nil'
138
+ end
139
+
140
+ if digest.to_s.length < 1
141
+ fail ArgumentError, 'invalid value for "digest", the character length must be great than or equal to 1.'
142
+ end
143
+
144
+ @digest = digest
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] media_type Value to be assigned
149
+ def media_type=(media_type)
150
+ if media_type.nil?
151
+ fail ArgumentError, 'media_type cannot be nil'
152
+ end
153
+
154
+ if media_type.to_s.length < 1
155
+ fail ArgumentError, 'invalid value for "media_type", the character length must be great than or equal to 1.'
156
+ end
157
+
158
+ @media_type = media_type
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ pulp_href == o.pulp_href &&
167
+ pulp_created == o.pulp_created &&
168
+ artifact == o.artifact &&
169
+ digest == o.digest &&
170
+ media_type == o.media_type
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [pulp_href, pulp_created, artifact, digest, media_type].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ new.build_from_hash(attributes)
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ self.class.openapi_types.each_pair do |key, type|
198
+ if type =~ /\AArray<(.*)>/i
199
+ # check to ensure the input is an array given that the attribute
200
+ # is documented as an array but the input is not
201
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
202
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
203
+ end
204
+ elsif !attributes[self.class.attribute_map[key]].nil?
205
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
207
+ end
208
+
209
+ self
210
+ end
211
+
212
+ # Deserializes the data based on type
213
+ # @param string type Data type
214
+ # @param string value Value to be deserialized
215
+ # @return [Object] Deserialized data
216
+ def _deserialize(type, value)
217
+ case type.to_sym
218
+ when :DateTime
219
+ DateTime.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :Boolean
229
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ PulpContainerClient.const_get(type).build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end
298
+ end
299
+ end
@@ -0,0 +1,342 @@
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.2-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ class ContainerContainerDistribution
17
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
18
+ attr_accessor :base_path
19
+
20
+ # A unique name. Ex, `rawhide` and `stable`.
21
+ attr_accessor :name
22
+
23
+ attr_accessor :pulp_href
24
+
25
+ # RepositoryVersion to be served
26
+ attr_accessor :repository_version
27
+
28
+ # The latest RepositoryVersion for this Repository will be served.
29
+ attr_accessor :repository
30
+
31
+ # An optional content-guard.
32
+ attr_accessor :content_guard
33
+
34
+ # Timestamp of creation.
35
+ attr_accessor :pulp_created
36
+
37
+ # The Registry hostame:port/name/ to use with docker pull command defined by this distribution.
38
+ attr_accessor :registry_path
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'base_path' => :'base_path',
44
+ :'name' => :'name',
45
+ :'pulp_href' => :'pulp_href',
46
+ :'repository_version' => :'repository_version',
47
+ :'repository' => :'repository',
48
+ :'content_guard' => :'content_guard',
49
+ :'pulp_created' => :'pulp_created',
50
+ :'registry_path' => :'registry_path'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'base_path' => :'String',
58
+ :'name' => :'String',
59
+ :'pulp_href' => :'String',
60
+ :'repository_version' => :'String',
61
+ :'repository' => :'String',
62
+ :'content_guard' => :'String',
63
+ :'pulp_created' => :'DateTime',
64
+ :'registry_path' => :'String'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'repository_version',
72
+ :'repository',
73
+ :'content_guard',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerDistribution` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'base_path')
93
+ self.base_path = attributes[:'base_path']
94
+ end
95
+
96
+ if attributes.key?(:'name')
97
+ self.name = attributes[:'name']
98
+ end
99
+
100
+ if attributes.key?(:'pulp_href')
101
+ self.pulp_href = attributes[:'pulp_href']
102
+ end
103
+
104
+ if attributes.key?(:'repository_version')
105
+ self.repository_version = attributes[:'repository_version']
106
+ end
107
+
108
+ if attributes.key?(:'repository')
109
+ self.repository = attributes[:'repository']
110
+ end
111
+
112
+ if attributes.key?(:'content_guard')
113
+ self.content_guard = attributes[:'content_guard']
114
+ end
115
+
116
+ if attributes.key?(:'pulp_created')
117
+ self.pulp_created = attributes[:'pulp_created']
118
+ end
119
+
120
+ if attributes.key?(:'registry_path')
121
+ self.registry_path = attributes[:'registry_path']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+ if @base_path.nil?
130
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
131
+ end
132
+
133
+ if @base_path.to_s.length < 1
134
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
135
+ end
136
+
137
+ if @name.nil?
138
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
139
+ end
140
+
141
+ if @name.to_s.length < 1
142
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
143
+ end
144
+
145
+ if !@registry_path.nil? && @registry_path.to_s.length < 1
146
+ invalid_properties.push('invalid value for "registry_path", the character length must be great than or equal to 1.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ return false if @base_path.nil?
156
+ return false if @base_path.to_s.length < 1
157
+ return false if @name.nil?
158
+ return false if @name.to_s.length < 1
159
+ return false if !@registry_path.nil? && @registry_path.to_s.length < 1
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] base_path Value to be assigned
165
+ def base_path=(base_path)
166
+ if base_path.nil?
167
+ fail ArgumentError, 'base_path cannot be nil'
168
+ end
169
+
170
+ if base_path.to_s.length < 1
171
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
172
+ end
173
+
174
+ @base_path = base_path
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] name Value to be assigned
179
+ def name=(name)
180
+ if name.nil?
181
+ fail ArgumentError, 'name cannot be nil'
182
+ end
183
+
184
+ if name.to_s.length < 1
185
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
186
+ end
187
+
188
+ @name = name
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] registry_path Value to be assigned
193
+ def registry_path=(registry_path)
194
+ if !registry_path.nil? && registry_path.to_s.length < 1
195
+ fail ArgumentError, 'invalid value for "registry_path", the character length must be great than or equal to 1.'
196
+ end
197
+
198
+ @registry_path = registry_path
199
+ end
200
+
201
+ # Checks equality by comparing each attribute.
202
+ # @param [Object] Object to be compared
203
+ def ==(o)
204
+ return true if self.equal?(o)
205
+ self.class == o.class &&
206
+ base_path == o.base_path &&
207
+ name == o.name &&
208
+ pulp_href == o.pulp_href &&
209
+ repository_version == o.repository_version &&
210
+ repository == o.repository &&
211
+ content_guard == o.content_guard &&
212
+ pulp_created == o.pulp_created &&
213
+ registry_path == o.registry_path
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Integer] Hash code
224
+ def hash
225
+ [base_path, name, pulp_href, repository_version, repository, content_guard, pulp_created, registry_path].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def self.build_from_hash(attributes)
232
+ new.build_from_hash(attributes)
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ self.class.openapi_types.each_pair do |key, type|
241
+ if type =~ /\AArray<(.*)>/i
242
+ # check to ensure the input is an array given that the attribute
243
+ # is documented as an array but the input is not
244
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
245
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
246
+ end
247
+ elsif !attributes[self.class.attribute_map[key]].nil?
248
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
249
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
250
+ end
251
+
252
+ self
253
+ end
254
+
255
+ # Deserializes the data based on type
256
+ # @param string type Data type
257
+ # @param string value Value to be deserialized
258
+ # @return [Object] Deserialized data
259
+ def _deserialize(type, value)
260
+ case type.to_sym
261
+ when :DateTime
262
+ DateTime.parse(value)
263
+ when :Date
264
+ Date.parse(value)
265
+ when :String
266
+ value.to_s
267
+ when :Integer
268
+ value.to_i
269
+ when :Float
270
+ value.to_f
271
+ when :Boolean
272
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
+ true
274
+ else
275
+ false
276
+ end
277
+ when :Object
278
+ # generic object (usually a Hash), return directly
279
+ value
280
+ when /\AArray<(?<inner_type>.+)>\z/
281
+ inner_type = Regexp.last_match[:inner_type]
282
+ value.map { |v| _deserialize(inner_type, v) }
283
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
+ k_type = Regexp.last_match[:k_type]
285
+ v_type = Regexp.last_match[:v_type]
286
+ {}.tap do |hash|
287
+ value.each do |k, v|
288
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
289
+ end
290
+ end
291
+ else # model
292
+ PulpContainerClient.const_get(type).build_from_hash(value)
293
+ end
294
+ end
295
+
296
+ # Returns the string representation of the object
297
+ # @return [String] String presentation of the object
298
+ def to_s
299
+ to_hash.to_s
300
+ end
301
+
302
+ # to_body is an alias to to_hash (backward compatibility)
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_body
305
+ to_hash
306
+ end
307
+
308
+ # Returns the object in the form of hash
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_hash
311
+ hash = {}
312
+ self.class.attribute_map.each_pair do |attr, param|
313
+ value = self.send(attr)
314
+ if value.nil?
315
+ is_nullable = self.class.openapi_nullable.include?(attr)
316
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
+ end
318
+
319
+ hash[param] = _to_hash(value)
320
+ end
321
+ hash
322
+ end
323
+
324
+ # Outputs non-array value in the form of hash
325
+ # For object, use to_hash. Otherwise, just return the value
326
+ # @param [Object] value Any valid value
327
+ # @return [Hash] Returns the value in the form of hash
328
+ def _to_hash(value)
329
+ if value.is_a?(Array)
330
+ value.compact.map { |v| _to_hash(v) }
331
+ elsif value.is_a?(Hash)
332
+ {}.tap do |hash|
333
+ value.each { |k, v| hash[k] = _to_hash(v) }
334
+ end
335
+ elsif value.respond_to? :to_hash
336
+ value.to_hash
337
+ else
338
+ value
339
+ end
340
+ end
341
+ end
342
+ end