pulp_python_client 3.21.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -5
  3. data/docs/ContentPackagesApi.md +6 -2
  4. data/docs/ContentProvenanceApi.md +428 -0
  5. data/docs/FiletypeEnum.md +15 -0
  6. data/docs/MetadataVersionEnum.md +15 -0
  7. data/docs/PaginatedpythonPackageProvenanceResponseList.md +24 -0
  8. data/docs/PatchedpythonPythonRemote.md +3 -1
  9. data/docs/ProtocolVersionEnum.md +15 -0
  10. data/docs/PypiLegacyApi.md +9 -1
  11. data/docs/PypiProvenanceApi.md +91 -0
  12. data/docs/PypiSimpleApi.md +9 -1
  13. data/docs/PythonPackageProvenanceResponse.md +34 -0
  14. data/docs/PythonPythonPackageContentResponse.md +3 -1
  15. data/docs/PythonPythonRemote.md +3 -1
  16. data/docs/PythonPythonRemoteResponse.md +3 -1
  17. data/lib/pulp_python_client/api/content_packages_api.rb +6 -0
  18. data/lib/pulp_python_client/api/content_provenance_api.rb +448 -0
  19. data/lib/pulp_python_client/api/pypi_legacy_api.rb +12 -0
  20. data/lib/pulp_python_client/api/pypi_provenance_api.rb +110 -0
  21. data/lib/pulp_python_client/api/pypi_simple_api.rb +12 -0
  22. data/lib/pulp_python_client/models/filetype_enum.rb +40 -0
  23. data/lib/pulp_python_client/models/metadata_version_enum.rb +46 -0
  24. data/lib/pulp_python_client/models/paginatedpython_package_provenance_response_list.rb +257 -0
  25. data/lib/pulp_python_client/models/patchedpython_python_remote.rb +16 -4
  26. data/lib/pulp_python_client/models/protocol_version_enum.rb +39 -0
  27. data/lib/pulp_python_client/models/python_package_provenance_response.rb +302 -0
  28. data/lib/pulp_python_client/models/python_python_package_content_response.rb +15 -5
  29. data/lib/pulp_python_client/models/python_python_remote.rb +16 -4
  30. data/lib/pulp_python_client/models/python_python_remote_response.rb +16 -4
  31. data/lib/pulp_python_client/version.rb +1 -1
  32. data/lib/pulp_python_client.rb +7 -0
  33. data/spec/api/content_packages_api_spec.rb +2 -0
  34. data/spec/api/content_provenance_api_spec.rb +123 -0
  35. data/spec/api/pypi_legacy_api_spec.rb +4 -0
  36. data/spec/api/pypi_provenance_api_spec.rb +53 -0
  37. data/spec/api/pypi_simple_api_spec.rb +4 -0
  38. data/spec/models/filetype_enum_spec.rb +30 -0
  39. data/spec/models/metadata_version_enum_spec.rb +30 -0
  40. data/spec/models/paginatedpython_package_provenance_response_list_spec.rb +54 -0
  41. data/spec/models/patchedpython_python_remote_spec.rb +6 -0
  42. data/spec/models/protocol_version_enum_spec.rb +30 -0
  43. data/spec/models/python_package_provenance_response_spec.rb +84 -0
  44. data/spec/models/python_python_package_content_response_spec.rb +6 -0
  45. data/spec/models/python_python_remote_response_spec.rb +6 -0
  46. data/spec/models/python_python_remote_spec.rb +6 -0
  47. metadata +30 -2
@@ -0,0 +1,46 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpPythonClient
17
+ class MetadataVersionEnum
18
+ N1_0 = "1.0".freeze
19
+ N1_1 = "1.1".freeze
20
+ N1_2 = "1.2".freeze
21
+ N2_0 = "2.0".freeze
22
+ N2_1 = "2.1".freeze
23
+ N2_2 = "2.2".freeze
24
+ N2_3 = "2.3".freeze
25
+ N2_4 = "2.4".freeze
26
+
27
+ def self.all_vars
28
+ @all_vars ||= [N1_0, N1_1, N1_2, N2_0, N2_1, N2_2, N2_3, N2_4].freeze
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def self.build_from_hash(value)
35
+ new.build_from_hash(value)
36
+ end
37
+
38
+ # Builds the enum from string
39
+ # @param [String] The enum value in the form of the string
40
+ # @return [String] The enum value
41
+ def build_from_hash(value)
42
+ return value if MetadataVersionEnum.all_vars.include?(value)
43
+ raise "Invalid ENUM value #{value} for class #MetadataVersionEnum"
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,257 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpPythonClient
17
+ class PaginatedpythonPackageProvenanceResponseList
18
+ attr_accessor :count
19
+
20
+ attr_accessor :_next
21
+
22
+ attr_accessor :previous
23
+
24
+ attr_accessor :results
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'count' => :'count',
30
+ :'_next' => :'next',
31
+ :'previous' => :'previous',
32
+ :'results' => :'results'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'count' => :'Integer',
45
+ :'_next' => :'String',
46
+ :'previous' => :'String',
47
+ :'results' => :'Array<PythonPackageProvenanceResponse>'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
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 `PulpPythonClient::PaginatedpythonPackageProvenanceResponseList` 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 `PulpPythonClient::PaginatedpythonPackageProvenanceResponseList`. 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?(:'count')
73
+ self.count = attributes[:'count']
74
+ else
75
+ self.count = nil
76
+ end
77
+
78
+ if attributes.key?(:'_next')
79
+ self._next = attributes[:'_next']
80
+ end
81
+
82
+ if attributes.key?(:'previous')
83
+ self.previous = attributes[:'previous']
84
+ end
85
+
86
+ if attributes.key?(:'results')
87
+ if (value = attributes[:'results']).is_a?(Array)
88
+ self.results = value
89
+ end
90
+ else
91
+ self.results = nil
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @count.nil?
101
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
102
+ end
103
+
104
+ if @results.nil?
105
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @count.nil?
116
+ return false if @results.nil?
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ count == o.count &&
126
+ _next == o._next &&
127
+ previous == o.previous &&
128
+ results == o.results
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [count, _next, previous, results].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def self._deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = PulpPythonClient.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -96,6 +96,9 @@ module PulpPythonClient
96
96
  # List of platforms to exclude syncing Python packages for. Possible valuesinclude: windows, macos, freebsd, and linux.
97
97
  attr_accessor :exclude_platforms
98
98
 
99
+ # Whether to sync available provenances for Python packages.
100
+ attr_accessor :provenance
101
+
99
102
  class EnumAttributeValidator
100
103
  attr_reader :datatype
101
104
  attr_reader :allowable_values
@@ -147,7 +150,8 @@ module PulpPythonClient
147
150
  :'prereleases' => :'prereleases',
148
151
  :'package_types' => :'package_types',
149
152
  :'keep_latest_packages' => :'keep_latest_packages',
150
- :'exclude_platforms' => :'exclude_platforms'
153
+ :'exclude_platforms' => :'exclude_platforms',
154
+ :'provenance' => :'provenance'
151
155
  }
152
156
  end
153
157
 
@@ -185,7 +189,8 @@ module PulpPythonClient
185
189
  :'prereleases' => :'Boolean',
186
190
  :'package_types' => :'Array<PackageTypesEnum>',
187
191
  :'keep_latest_packages' => :'Integer',
188
- :'exclude_platforms' => :'Array<ExcludePlatformsEnum>'
192
+ :'exclude_platforms' => :'Array<ExcludePlatformsEnum>',
193
+ :'provenance' => :'Boolean'
189
194
  }
190
195
  end
191
196
 
@@ -346,6 +351,12 @@ module PulpPythonClient
346
351
  self.exclude_platforms = value
347
352
  end
348
353
  end
354
+
355
+ if attributes.key?(:'provenance')
356
+ self.provenance = attributes[:'provenance']
357
+ else
358
+ self.provenance = false
359
+ end
349
360
  end
350
361
 
351
362
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -612,7 +623,8 @@ module PulpPythonClient
612
623
  prereleases == o.prereleases &&
613
624
  package_types == o.package_types &&
614
625
  keep_latest_packages == o.keep_latest_packages &&
615
- exclude_platforms == o.exclude_platforms
626
+ exclude_platforms == o.exclude_platforms &&
627
+ provenance == o.provenance
616
628
  end
617
629
 
618
630
  # @see the `==` method
@@ -624,7 +636,7 @@ module PulpPythonClient
624
636
  # Calculates hash code according to all attributes.
625
637
  # @return [Integer] Hash code
626
638
  def hash
627
- [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, includes, excludes, prereleases, package_types, keep_latest_packages, exclude_platforms].hash
639
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, includes, excludes, prereleases, package_types, keep_latest_packages, exclude_platforms, provenance].hash
628
640
  end
629
641
 
630
642
  # Builds the object from hash
@@ -0,0 +1,39 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpPythonClient
17
+ class ProtocolVersionEnum
18
+ N1 = 1.freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [N1].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if ProtocolVersionEnum.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #ProtocolVersionEnum"
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,302 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpPythonClient
17
+ # A Serializer for PackageProvenance.
18
+ class PythonPackageProvenanceResponse
19
+ attr_accessor :pulp_href
20
+
21
+ # The Pulp Resource Name (PRN).
22
+ attr_accessor :prn
23
+
24
+ # Timestamp of creation.
25
+ attr_accessor :pulp_created
26
+
27
+ # Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
28
+ attr_accessor :pulp_last_updated
29
+
30
+ # A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
31
+ attr_accessor :pulp_labels
32
+
33
+ attr_accessor :vuln_report
34
+
35
+ # The package that the provenance is for.
36
+ attr_accessor :package
37
+
38
+ attr_accessor :provenance
39
+
40
+ attr_accessor :sha256
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'pulp_href' => :'pulp_href',
46
+ :'prn' => :'prn',
47
+ :'pulp_created' => :'pulp_created',
48
+ :'pulp_last_updated' => :'pulp_last_updated',
49
+ :'pulp_labels' => :'pulp_labels',
50
+ :'vuln_report' => :'vuln_report',
51
+ :'package' => :'package',
52
+ :'provenance' => :'provenance',
53
+ :'sha256' => :'sha256'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'pulp_href' => :'String',
66
+ :'prn' => :'String',
67
+ :'pulp_created' => :'Time',
68
+ :'pulp_last_updated' => :'Time',
69
+ :'pulp_labels' => :'Hash<String, String>',
70
+ :'vuln_report' => :'String',
71
+ :'package' => :'String',
72
+ :'provenance' => :'Object',
73
+ :'sha256' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ :'provenance',
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::PythonPackageProvenanceResponse` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!self.class.attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::PythonPackageProvenanceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'pulp_href')
100
+ self.pulp_href = attributes[:'pulp_href']
101
+ end
102
+
103
+ if attributes.key?(:'prn')
104
+ self.prn = attributes[:'prn']
105
+ end
106
+
107
+ if attributes.key?(:'pulp_created')
108
+ self.pulp_created = attributes[:'pulp_created']
109
+ end
110
+
111
+ if attributes.key?(:'pulp_last_updated')
112
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
113
+ end
114
+
115
+ if attributes.key?(:'pulp_labels')
116
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
117
+ self.pulp_labels = value
118
+ end
119
+ end
120
+
121
+ if attributes.key?(:'vuln_report')
122
+ self.vuln_report = attributes[:'vuln_report']
123
+ end
124
+
125
+ if attributes.key?(:'package')
126
+ self.package = attributes[:'package']
127
+ else
128
+ self.package = nil
129
+ end
130
+
131
+ if attributes.key?(:'provenance')
132
+ self.provenance = attributes[:'provenance']
133
+ end
134
+
135
+ if attributes.key?(:'sha256')
136
+ self.sha256 = attributes[:'sha256']
137
+ end
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
144
+ invalid_properties = Array.new
145
+ if @package.nil?
146
+ invalid_properties.push('invalid value for "package", package cannot be nil.')
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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @package.nil?
157
+ true
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ pulp_href == o.pulp_href &&
166
+ prn == o.prn &&
167
+ pulp_created == o.pulp_created &&
168
+ pulp_last_updated == o.pulp_last_updated &&
169
+ pulp_labels == o.pulp_labels &&
170
+ vuln_report == o.vuln_report &&
171
+ package == o.package &&
172
+ provenance == o.provenance &&
173
+ sha256 == o.sha256
174
+ end
175
+
176
+ # @see the `==` method
177
+ # @param [Object] Object to be compared
178
+ def eql?(o)
179
+ self == o
180
+ end
181
+
182
+ # Calculates hash code according to all attributes.
183
+ # @return [Integer] Hash code
184
+ def hash
185
+ [pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, vuln_report, package, provenance, sha256].hash
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def self.build_from_hash(attributes)
192
+ return nil unless attributes.is_a?(Hash)
193
+ attributes = attributes.transform_keys(&:to_sym)
194
+ transformed_hash = {}
195
+ openapi_types.each_pair do |key, type|
196
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = nil
198
+ elsif 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[attribute_map[key]].is_a?(Array)
202
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
203
+ end
204
+ elsif !attributes[attribute_map[key]].nil?
205
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
206
+ end
207
+ end
208
+ new(transformed_hash)
209
+ end
210
+
211
+ # Deserializes the data based on type
212
+ # @param string type Data type
213
+ # @param string value Value to be deserialized
214
+ # @return [Object] Deserialized data
215
+ def self._deserialize(type, value)
216
+ case type.to_sym
217
+ when :Time
218
+ Time.parse(value)
219
+ when :Date
220
+ Date.parse(value)
221
+ when :String
222
+ value.to_s
223
+ when :Integer
224
+ value.to_i
225
+ when :Float
226
+ value.to_f
227
+ when :Boolean
228
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
+ true
230
+ else
231
+ false
232
+ end
233
+ when :Object
234
+ # generic object (usually a Hash), return directly
235
+ value
236
+ when /\AArray<(?<inner_type>.+)>\z/
237
+ inner_type = Regexp.last_match[:inner_type]
238
+ value.map { |v| _deserialize(inner_type, v) }
239
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
+ k_type = Regexp.last_match[:k_type]
241
+ v_type = Regexp.last_match[:v_type]
242
+ {}.tap do |hash|
243
+ value.each do |k, v|
244
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
+ end
246
+ end
247
+ else # model
248
+ # models (e.g. Pet) or oneOf
249
+ klass = PulpPythonClient.const_get(type)
250
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
251
+ end
252
+ end
253
+
254
+ # Returns the string representation of the object
255
+ # @return [String] String presentation of the object
256
+ def to_s
257
+ to_hash.to_s
258
+ end
259
+
260
+ # to_body is an alias to to_hash (backward compatibility)
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_body
263
+ to_hash
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ self.class.attribute_map.each_pair do |attr, param|
271
+ value = self.send(attr)
272
+ if value.nil?
273
+ is_nullable = self.class.openapi_nullable.include?(attr)
274
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
275
+ end
276
+
277
+ hash[param] = _to_hash(value)
278
+ end
279
+ hash
280
+ end
281
+
282
+ # Outputs non-array value in the form of hash
283
+ # For object, use to_hash. Otherwise, just return the value
284
+ # @param [Object] value Any valid value
285
+ # @return [Hash] Returns the value in the form of hash
286
+ def _to_hash(value)
287
+ if value.is_a?(Array)
288
+ value.compact.map { |v| _to_hash(v) }
289
+ elsif value.is_a?(Hash)
290
+ {}.tap do |hash|
291
+ value.each { |k, v| hash[k] = _to_hash(v) }
292
+ end
293
+ elsif value.respond_to? :to_hash
294
+ value.to_hash
295
+ else
296
+ value
297
+ end
298
+ end
299
+
300
+ end
301
+
302
+ end