pulp_ostree_client 2.0.0a1.dev1626751709 → 2.0.0a1.dev1631416829

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pulp_ostree_client might be problematic. Click here for more details.

Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -23
  3. data/docs/ContentCommitsApi.md +138 -0
  4. data/docs/ContentConfigsApi.md +138 -0
  5. data/docs/ContentObjectsApi.md +138 -0
  6. data/docs/ContentRefsApi.md +138 -0
  7. data/docs/{ContentOstreeApi.md → ContentSummariesApi.md} +21 -75
  8. data/docs/DistributionsOstreeApi.md +3 -3
  9. data/docs/OstreeOstreeCommitResponse.md +25 -0
  10. data/docs/OstreeOstreeConfigResponse.md +21 -0
  11. data/docs/OstreeOstreeDistribution.md +2 -2
  12. data/docs/OstreeOstreeDistributionResponse.md +2 -2
  13. data/docs/OstreeOstreeObjectResponse.md +27 -0
  14. data/docs/OstreeOstreeRefResponse.md +25 -0
  15. data/docs/OstreeOstreeRemote.md +4 -2
  16. data/docs/OstreeOstreeRemoteResponse.md +4 -2
  17. data/docs/OstreeOstreeRepository.md +3 -3
  18. data/docs/OstreeOstreeRepositoryResponse.md +3 -3
  19. data/docs/{OstreeOstreeContentResponse.md → OstreeOstreeSummaryResponse.md} +2 -2
  20. data/docs/OstreeRepoImport.md +23 -0
  21. data/docs/{PaginatedostreeOstreePublicationResponseList.md → PaginatedostreeOstreeCommitResponseList.md} +3 -3
  22. data/docs/PaginatedostreeOstreeConfigResponseList.md +23 -0
  23. data/docs/PaginatedostreeOstreeObjectResponseList.md +23 -0
  24. data/docs/PaginatedostreeOstreeRefResponseList.md +23 -0
  25. data/docs/{PaginatedostreeOstreeContentResponseList.md → PaginatedostreeOstreeSummaryResponseList.md} +3 -3
  26. data/docs/PatchedostreeOstreeDistribution.md +2 -2
  27. data/docs/PatchedostreeOstreeRemote.md +4 -2
  28. data/docs/PatchedostreeOstreeRepository.md +3 -3
  29. data/docs/RemotesOstreeApi.md +4 -4
  30. data/docs/RepositoriesOstreeApi.md +60 -4
  31. data/docs/RepositoriesOstreeVersionsApi.md +3 -3
  32. data/lib/pulp_ostree_client/api/content_commits_api.rb +170 -0
  33. data/lib/pulp_ostree_client/api/content_configs_api.rb +170 -0
  34. data/lib/pulp_ostree_client/api/content_objects_api.rb +170 -0
  35. data/lib/pulp_ostree_client/api/content_refs_api.rb +170 -0
  36. data/lib/pulp_ostree_client/api/{content_ostree_api.rb → content_summaries_api.rb} +29 -93
  37. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +4 -4
  38. data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +6 -6
  39. data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +76 -6
  40. data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +4 -4
  41. data/lib/pulp_ostree_client/configuration.rb +2 -2
  42. data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +256 -0
  43. data/lib/pulp_ostree_client/models/{ostree_ostree_publication_response.rb → ostree_ostree_config_response.rb} +17 -21
  44. data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +10 -10
  45. data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +10 -10
  46. data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +275 -0
  47. data/lib/pulp_ostree_client/models/{ostree_ostree_content.rb → ostree_ostree_ref_response.rb} +47 -15
  48. data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +34 -7
  49. data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +34 -7
  50. data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +18 -17
  51. data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +18 -17
  52. data/lib/pulp_ostree_client/models/{ostree_ostree_content_response.rb → ostree_ostree_summary_response.rb} +4 -4
  53. data/lib/pulp_ostree_client/models/ostree_repo_import.rb +248 -0
  54. data/lib/pulp_ostree_client/models/{paginatedostree_ostree_publication_response_list.rb → paginatedostree_ostree_commit_response_list.rb} +4 -4
  55. data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +237 -0
  56. data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +237 -0
  57. data/lib/pulp_ostree_client/models/{ostree_ostree_publication.rb → paginatedostree_ostree_ref_response_list.rb} +38 -18
  58. data/lib/pulp_ostree_client/models/{paginatedostree_ostree_content_response_list.rb → paginatedostree_ostree_summary_response_list.rb} +4 -4
  59. data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +10 -10
  60. data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +34 -7
  61. data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +18 -17
  62. data/lib/pulp_ostree_client/models/policy_enum.rb +1 -1
  63. data/lib/pulp_ostree_client/version.rb +1 -1
  64. data/lib/pulp_ostree_client.rb +16 -8
  65. data/spec/api/{content_ostree_api_spec.rb → content_commits_api_spec.rb} +13 -25
  66. data/spec/api/content_configs_api_spec.rb +68 -0
  67. data/spec/api/content_objects_api_spec.rb +68 -0
  68. data/spec/api/content_refs_api_spec.rb +68 -0
  69. data/spec/api/content_summaries_api_spec.rb +68 -0
  70. data/spec/api/distributions_ostree_api_spec.rb +2 -2
  71. data/spec/api/remotes_ostree_api_spec.rb +3 -3
  72. data/spec/api/repositories_ostree_api_spec.rb +16 -3
  73. data/spec/api/repositories_ostree_versions_api_spec.rb +2 -2
  74. data/spec/configuration_spec.rb +3 -3
  75. data/spec/models/ostree_ostree_commit_response_spec.rb +65 -0
  76. data/spec/models/{ostree_ostree_content_spec.rb → ostree_ostree_config_response_spec.rb} +14 -8
  77. data/spec/models/ostree_ostree_distribution_response_spec.rb +1 -1
  78. data/spec/models/ostree_ostree_distribution_spec.rb +1 -1
  79. data/spec/models/ostree_ostree_object_response_spec.rb +71 -0
  80. data/spec/models/{ostree_ostree_publication_response_spec.rb → ostree_ostree_ref_response_spec.rb} +14 -8
  81. data/spec/models/ostree_ostree_remote_response_spec.rb +6 -0
  82. data/spec/models/ostree_ostree_remote_spec.rb +6 -0
  83. data/spec/models/ostree_ostree_repository_response_spec.rb +1 -1
  84. data/spec/models/ostree_ostree_repository_spec.rb +1 -1
  85. data/spec/models/{ostree_ostree_content_response_spec.rb → ostree_ostree_summary_response_spec.rb} +6 -6
  86. data/spec/models/ostree_repo_import_spec.rb +59 -0
  87. data/spec/models/{paginatedostree_ostree_publication_response_list_spec.rb → paginatedostree_ostree_commit_response_list_spec.rb} +6 -6
  88. data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +59 -0
  89. data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +59 -0
  90. data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +59 -0
  91. data/spec/models/{paginatedostree_ostree_content_response_list_spec.rb → paginatedostree_ostree_summary_response_list_spec.rb} +6 -6
  92. data/spec/models/patchedostree_ostree_distribution_spec.rb +1 -1
  93. data/spec/models/patchedostree_ostree_remote_spec.rb +6 -0
  94. data/spec/models/patchedostree_ostree_repository_spec.rb +1 -1
  95. metadata +81 -49
  96. data/docs/OstreeOstreeContent.md +0 -19
  97. data/docs/OstreeOstreePublication.md +0 -19
  98. data/docs/OstreeOstreePublicationResponse.md +0 -23
  99. data/docs/PublicationsOstreeApi.md +0 -257
  100. data/lib/pulp_ostree_client/api/publications_ostree_api.rb +0 -312
  101. data/spec/api/publications_ostree_api_spec.rb +0 -98
  102. data/spec/models/ostree_ostree_publication_spec.rb +0 -47
@@ -13,8 +13,8 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module PulpOstreeClient
16
- # A Serializer for OstreeContent. Add serializers for the new fields defined in OstreeContent and add those fields to the Meta class keeping fields from the parent class as well. For example:: field1 = serializers.TextField() field2 = serializers.IntegerField() field3 = serializers.CharField() class Meta: fields = platform.SingleArtifactContentSerializer.Meta.fields + ( 'field1', 'field2', 'field3' ) model = models.OstreeContent
17
- class OstreeOstreeContentResponse
16
+ # A Serializer class for an OSTree summary file.
17
+ class OstreeOstreeSummaryResponse
18
18
  attr_accessor :pulp_href
19
19
 
20
20
  # Timestamp of creation.
@@ -51,13 +51,13 @@ module PulpOstreeClient
51
51
  # @param [Hash] attributes Model attributes in the form of hash
52
52
  def initialize(attributes = {})
53
53
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeContentResponse` initialize method"
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeSummaryResponse` initialize method"
55
55
  end
56
56
 
57
57
  # check to see if the attribute exists and convert string to symbol for hash key
58
58
  attributes = attributes.each_with_object({}) { |(k, v), h|
59
59
  if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeContentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeSummaryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
61
  end
62
62
  h[k.to_sym] = v
63
63
  }
@@ -0,0 +1,248 @@
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 PulpOstreeClient
16
+ # A Serializer class for importing commits to a Pulp OSTree repository.
17
+ class OstreeRepoImport
18
+ # An artifact representing OSTree content compressed as a tarball.
19
+ attr_accessor :artifact
20
+
21
+ # The name of a repository that contains the compressed OSTree content.
22
+ attr_accessor :repository_name
23
+
24
+ # The name of a ref branch that holds the reference to the last commit.
25
+ attr_accessor :ref
26
+
27
+ # The checksum of a parent commit with which the content needs to be associated.
28
+ attr_accessor :parent_commit
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'artifact' => :'artifact',
34
+ :'repository_name' => :'repository_name',
35
+ :'ref' => :'ref',
36
+ :'parent_commit' => :'parent_commit'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'artifact' => :'String',
44
+ :'repository_name' => :'String',
45
+ :'ref' => :'String',
46
+ :'parent_commit' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeRepoImport` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeRepoImport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'artifact')
72
+ self.artifact = attributes[:'artifact']
73
+ end
74
+
75
+ if attributes.key?(:'repository_name')
76
+ self.repository_name = attributes[:'repository_name']
77
+ end
78
+
79
+ if attributes.key?(:'ref')
80
+ self.ref = attributes[:'ref']
81
+ end
82
+
83
+ if attributes.key?(:'parent_commit')
84
+ self.parent_commit = attributes[:'parent_commit']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ if @artifact.nil?
93
+ invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
94
+ end
95
+
96
+ if @repository_name.nil?
97
+ invalid_properties.push('invalid value for "repository_name", repository_name cannot be nil.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if @artifact.nil?
107
+ return false if @repository_name.nil?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ artifact == o.artifact &&
117
+ repository_name == o.repository_name &&
118
+ ref == o.ref &&
119
+ parent_commit == o.parent_commit
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [artifact, repository_name, ref, parent_commit].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.openapi_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ PulpOstreeClient.const_get(type).build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+ end
248
+ end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module PulpOstreeClient
16
- class PaginatedostreeOstreePublicationResponseList
16
+ class PaginatedostreeOstreeCommitResponseList
17
17
  attr_accessor :count
18
18
 
19
19
  attr_accessor :_next
@@ -38,7 +38,7 @@ module PulpOstreeClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<OstreeOstreePublicationResponse>'
41
+ :'results' => :'Array<OstreeOstreeCommitResponse>'
42
42
  }
43
43
  end
44
44
 
@@ -54,13 +54,13 @@ module PulpOstreeClient
54
54
  # @param [Hash] attributes Model attributes in the form of hash
55
55
  def initialize(attributes = {})
56
56
  if (!attributes.is_a?(Hash))
57
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::PaginatedostreeOstreePublicationResponseList` initialize method"
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::PaginatedostreeOstreeCommitResponseList` initialize method"
58
58
  end
59
59
 
60
60
  # check to see if the attribute exists and convert string to symbol for hash key
61
61
  attributes = attributes.each_with_object({}) { |(k, v), h|
62
62
  if (!self.class.attribute_map.key?(k.to_sym))
63
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::PaginatedostreeOstreePublicationResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::PaginatedostreeOstreeCommitResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
64
  end
65
65
  h[k.to_sym] = v
66
66
  }
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpOstreeClient
16
+ class PaginatedostreeOstreeConfigResponseList
17
+ attr_accessor :count
18
+
19
+ attr_accessor :_next
20
+
21
+ attr_accessor :previous
22
+
23
+ attr_accessor :results
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'count' => :'count',
29
+ :'_next' => :'next',
30
+ :'previous' => :'previous',
31
+ :'results' => :'results'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'count' => :'Integer',
39
+ :'_next' => :'String',
40
+ :'previous' => :'String',
41
+ :'results' => :'Array<OstreeOstreeConfigResponse>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'_next',
49
+ :'previous',
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::PaginatedostreeOstreeConfigResponseList` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::PaginatedostreeOstreeConfigResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'count')
69
+ self.count = attributes[:'count']
70
+ end
71
+
72
+ if attributes.key?(:'_next')
73
+ self._next = attributes[:'_next']
74
+ end
75
+
76
+ if attributes.key?(:'previous')
77
+ self.previous = attributes[:'previous']
78
+ end
79
+
80
+ if attributes.key?(:'results')
81
+ if (value = attributes[:'results']).is_a?(Array)
82
+ self.results = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ count == o.count &&
106
+ _next == o._next &&
107
+ previous == o.previous &&
108
+ results == o.results
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [count, _next, previous, results].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ PulpOstreeClient.const_get(type).build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end