pulp_ostree_client 2.0.0a1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +174 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentCommitsApi.md +138 -0
  7. data/docs/ContentConfigsApi.md +138 -0
  8. data/docs/ContentObjectsApi.md +138 -0
  9. data/docs/ContentRefsApi.md +138 -0
  10. data/docs/ContentSummariesApi.md +138 -0
  11. data/docs/ContentSummary.md +21 -0
  12. data/docs/ContentSummaryResponse.md +21 -0
  13. data/docs/DistributionsOstreeApi.md +372 -0
  14. data/docs/OstreeOstreeCommitResponse.md +25 -0
  15. data/docs/OstreeOstreeConfigResponse.md +21 -0
  16. data/docs/OstreeOstreeDistribution.md +27 -0
  17. data/docs/OstreeOstreeDistributionResponse.md +33 -0
  18. data/docs/OstreeOstreeObjectResponse.md +27 -0
  19. data/docs/OstreeOstreeRefResponse.md +25 -0
  20. data/docs/OstreeOstreeRemote.md +59 -0
  21. data/docs/OstreeOstreeRemoteResponse.md +55 -0
  22. data/docs/OstreeOstreeRepository.md +25 -0
  23. data/docs/OstreeOstreeRepositoryResponse.md +33 -0
  24. data/docs/OstreeOstreeSummaryResponse.md +21 -0
  25. data/docs/OstreeRepoImport.md +23 -0
  26. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  27. data/docs/PaginatedostreeOstreeCommitResponseList.md +23 -0
  28. data/docs/PaginatedostreeOstreeConfigResponseList.md +23 -0
  29. data/docs/PaginatedostreeOstreeDistributionResponseList.md +23 -0
  30. data/docs/PaginatedostreeOstreeObjectResponseList.md +23 -0
  31. data/docs/PaginatedostreeOstreeRefResponseList.md +23 -0
  32. data/docs/PaginatedostreeOstreeRemoteResponseList.md +23 -0
  33. data/docs/PaginatedostreeOstreeRepositoryResponseList.md +23 -0
  34. data/docs/PaginatedostreeOstreeSummaryResponseList.md +23 -0
  35. data/docs/PatchedostreeOstreeDistribution.md +27 -0
  36. data/docs/PatchedostreeOstreeRemote.md +59 -0
  37. data/docs/PatchedostreeOstreeRepository.md +25 -0
  38. data/docs/PolicyEnum.md +16 -0
  39. data/docs/RemotesOstreeApi.md +376 -0
  40. data/docs/RepositoriesOstreeApi.md +532 -0
  41. data/docs/RepositoriesOstreeVersionsApi.md +271 -0
  42. data/docs/RepositoryAddRemoveContent.md +21 -0
  43. data/docs/RepositorySyncURL.md +19 -0
  44. data/docs/RepositoryVersion.md +17 -0
  45. data/docs/RepositoryVersionResponse.md +27 -0
  46. data/git_push.sh +58 -0
  47. data/lib/pulp_ostree_client/api/content_commits_api.rb +170 -0
  48. data/lib/pulp_ostree_client/api/content_configs_api.rb +170 -0
  49. data/lib/pulp_ostree_client/api/content_objects_api.rb +170 -0
  50. data/lib/pulp_ostree_client/api/content_refs_api.rb +170 -0
  51. data/lib/pulp_ostree_client/api/content_summaries_api.rb +170 -0
  52. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +457 -0
  53. data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +463 -0
  54. data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +655 -0
  55. data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +339 -0
  56. data/lib/pulp_ostree_client/api_client.rb +406 -0
  57. data/lib/pulp_ostree_client/api_error.rb +57 -0
  58. data/lib/pulp_ostree_client/configuration.rb +250 -0
  59. data/lib/pulp_ostree_client/models/async_operation_response.rb +213 -0
  60. data/lib/pulp_ostree_client/models/content_summary.rb +246 -0
  61. data/lib/pulp_ostree_client/models/content_summary_response.rb +246 -0
  62. data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +256 -0
  63. data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +232 -0
  64. data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +270 -0
  65. data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +299 -0
  66. data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +275 -0
  67. data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +260 -0
  68. data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +536 -0
  69. data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +510 -0
  70. data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +270 -0
  71. data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +307 -0
  72. data/lib/pulp_ostree_client/models/ostree_ostree_summary_response.rb +232 -0
  73. data/lib/pulp_ostree_client/models/ostree_repo_import.rb +248 -0
  74. data/lib/pulp_ostree_client/models/paginated_repository_version_response_list.rb +237 -0
  75. data/lib/pulp_ostree_client/models/paginatedostree_ostree_commit_response_list.rb +237 -0
  76. data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +237 -0
  77. data/lib/pulp_ostree_client/models/paginatedostree_ostree_distribution_response_list.rb +237 -0
  78. data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +237 -0
  79. data/lib/pulp_ostree_client/models/paginatedostree_ostree_ref_response_list.rb +237 -0
  80. data/lib/pulp_ostree_client/models/paginatedostree_ostree_remote_response_list.rb +237 -0
  81. data/lib/pulp_ostree_client/models/paginatedostree_ostree_repository_response_list.rb +237 -0
  82. data/lib/pulp_ostree_client/models/paginatedostree_ostree_summary_response_list.rb +237 -0
  83. data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +260 -0
  84. data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +526 -0
  85. data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +265 -0
  86. data/lib/pulp_ostree_client/models/policy_enum.rb +36 -0
  87. data/lib/pulp_ostree_client/models/repository_add_remove_content.rb +232 -0
  88. data/lib/pulp_ostree_client/models/repository_sync_url.rb +220 -0
  89. data/lib/pulp_ostree_client/models/repository_version.rb +208 -0
  90. data/lib/pulp_ostree_client/models/repository_version_response.rb +255 -0
  91. data/lib/pulp_ostree_client/version.rb +15 -0
  92. data/lib/pulp_ostree_client.rb +80 -0
  93. data/pulp_ostree_client.gemspec +39 -0
  94. data/spec/api/content_commits_api_spec.rb +68 -0
  95. data/spec/api/content_configs_api_spec.rb +68 -0
  96. data/spec/api/content_objects_api_spec.rb +68 -0
  97. data/spec/api/content_refs_api_spec.rb +68 -0
  98. data/spec/api/content_summaries_api_spec.rb +68 -0
  99. data/spec/api/distributions_ostree_api_spec.rb +125 -0
  100. data/spec/api/remotes_ostree_api_spec.rb +127 -0
  101. data/spec/api/repositories_ostree_api_spec.rb +160 -0
  102. data/spec/api/repositories_ostree_versions_api_spec.rb +104 -0
  103. data/spec/api_client_spec.rb +188 -0
  104. data/spec/configuration_spec.rb +42 -0
  105. data/spec/models/async_operation_response_spec.rb +41 -0
  106. data/spec/models/content_summary_response_spec.rb +53 -0
  107. data/spec/models/content_summary_spec.rb +53 -0
  108. data/spec/models/ostree_ostree_commit_response_spec.rb +65 -0
  109. data/spec/models/ostree_ostree_config_response_spec.rb +53 -0
  110. data/spec/models/ostree_ostree_distribution_response_spec.rb +89 -0
  111. data/spec/models/ostree_ostree_distribution_spec.rb +71 -0
  112. data/spec/models/ostree_ostree_object_response_spec.rb +71 -0
  113. data/spec/models/ostree_ostree_ref_response_spec.rb +65 -0
  114. data/spec/models/ostree_ostree_remote_response_spec.rb +155 -0
  115. data/spec/models/ostree_ostree_remote_spec.rb +167 -0
  116. data/spec/models/ostree_ostree_repository_response_spec.rb +89 -0
  117. data/spec/models/ostree_ostree_repository_spec.rb +65 -0
  118. data/spec/models/ostree_ostree_summary_response_spec.rb +53 -0
  119. data/spec/models/ostree_repo_import_spec.rb +59 -0
  120. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  121. data/spec/models/paginatedostree_ostree_commit_response_list_spec.rb +59 -0
  122. data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +59 -0
  123. data/spec/models/paginatedostree_ostree_distribution_response_list_spec.rb +59 -0
  124. data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +59 -0
  125. data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +59 -0
  126. data/spec/models/paginatedostree_ostree_remote_response_list_spec.rb +59 -0
  127. data/spec/models/paginatedostree_ostree_repository_response_list_spec.rb +59 -0
  128. data/spec/models/paginatedostree_ostree_summary_response_list_spec.rb +59 -0
  129. data/spec/models/patchedostree_ostree_distribution_spec.rb +71 -0
  130. data/spec/models/patchedostree_ostree_remote_spec.rb +167 -0
  131. data/spec/models/patchedostree_ostree_repository_spec.rb +65 -0
  132. data/spec/models/policy_enum_spec.rb +35 -0
  133. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  134. data/spec/models/repository_sync_url_spec.rb +47 -0
  135. data/spec/models/repository_version_response_spec.rb +71 -0
  136. data/spec/models/repository_version_spec.rb +41 -0
  137. data/spec/spec_helper.rb +111 -0
  138. metadata +277 -0
@@ -0,0 +1,270 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpOstreeClient
16
+ # A Serializer class for an OSTree distribution.
17
+ class OstreeOstreeDistribution
18
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
19
+ attr_accessor :base_path
20
+
21
+ # An optional content-guard.
22
+ attr_accessor :content_guard
23
+
24
+ attr_accessor :pulp_labels
25
+
26
+ # A unique name. Ex, `rawhide` and `stable`.
27
+ attr_accessor :name
28
+
29
+ # The latest RepositoryVersion for this Repository will be served.
30
+ attr_accessor :repository
31
+
32
+ # RepositoryVersion to be served
33
+ attr_accessor :repository_version
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'base_path' => :'base_path',
39
+ :'content_guard' => :'content_guard',
40
+ :'pulp_labels' => :'pulp_labels',
41
+ :'name' => :'name',
42
+ :'repository' => :'repository',
43
+ :'repository_version' => :'repository_version'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'base_path' => :'String',
51
+ :'content_guard' => :'String',
52
+ :'pulp_labels' => :'Object',
53
+ :'name' => :'String',
54
+ :'repository' => :'String',
55
+ :'repository_version' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'content_guard',
63
+ :'repository',
64
+ :'repository_version'
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeDistribution` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'base_path')
84
+ self.base_path = attributes[:'base_path']
85
+ end
86
+
87
+ if attributes.key?(:'content_guard')
88
+ self.content_guard = attributes[:'content_guard']
89
+ end
90
+
91
+ if attributes.key?(:'pulp_labels')
92
+ self.pulp_labels = attributes[:'pulp_labels']
93
+ end
94
+
95
+ if attributes.key?(:'name')
96
+ self.name = attributes[:'name']
97
+ end
98
+
99
+ if attributes.key?(:'repository')
100
+ self.repository = attributes[:'repository']
101
+ end
102
+
103
+ if attributes.key?(:'repository_version')
104
+ self.repository_version = attributes[:'repository_version']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ if @base_path.nil?
113
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
114
+ end
115
+
116
+ if @name.nil?
117
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ return false if @base_path.nil?
127
+ return false if @name.nil?
128
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ base_path == o.base_path &&
137
+ content_guard == o.content_guard &&
138
+ pulp_labels == o.pulp_labels &&
139
+ name == o.name &&
140
+ repository == o.repository &&
141
+ repository_version == o.repository_version
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [base_path, content_guard, pulp_labels, name, repository, repository_version].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.openapi_types.each_pair do |key, type|
169
+ if type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :DateTime
190
+ DateTime.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ PulpOstreeClient.const_get(type).build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+ end
270
+ end
@@ -0,0 +1,299 @@
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 an OSTree distribution.
17
+ class OstreeOstreeDistributionResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
24
+ attr_accessor :base_path
25
+
26
+ # The URL for accessing the publication as defined by this distribution.
27
+ attr_accessor :base_url
28
+
29
+ # An optional content-guard.
30
+ attr_accessor :content_guard
31
+
32
+ attr_accessor :pulp_labels
33
+
34
+ # A unique name. Ex, `rawhide` and `stable`.
35
+ attr_accessor :name
36
+
37
+ # The latest RepositoryVersion for this Repository will be served.
38
+ attr_accessor :repository
39
+
40
+ # RepositoryVersion to be served
41
+ attr_accessor :repository_version
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'pulp_href' => :'pulp_href',
47
+ :'pulp_created' => :'pulp_created',
48
+ :'base_path' => :'base_path',
49
+ :'base_url' => :'base_url',
50
+ :'content_guard' => :'content_guard',
51
+ :'pulp_labels' => :'pulp_labels',
52
+ :'name' => :'name',
53
+ :'repository' => :'repository',
54
+ :'repository_version' => :'repository_version'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'pulp_href' => :'String',
62
+ :'pulp_created' => :'DateTime',
63
+ :'base_path' => :'String',
64
+ :'base_url' => :'String',
65
+ :'content_guard' => :'String',
66
+ :'pulp_labels' => :'Object',
67
+ :'name' => :'String',
68
+ :'repository' => :'String',
69
+ :'repository_version' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'content_guard',
77
+ :'repository',
78
+ :'repository_version'
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeDistributionResponse` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeDistributionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'pulp_href')
98
+ self.pulp_href = attributes[:'pulp_href']
99
+ end
100
+
101
+ if attributes.key?(:'pulp_created')
102
+ self.pulp_created = attributes[:'pulp_created']
103
+ end
104
+
105
+ if attributes.key?(:'base_path')
106
+ self.base_path = attributes[:'base_path']
107
+ end
108
+
109
+ if attributes.key?(:'base_url')
110
+ self.base_url = attributes[:'base_url']
111
+ end
112
+
113
+ if attributes.key?(:'content_guard')
114
+ self.content_guard = attributes[:'content_guard']
115
+ end
116
+
117
+ if attributes.key?(:'pulp_labels')
118
+ self.pulp_labels = attributes[:'pulp_labels']
119
+ end
120
+
121
+ if attributes.key?(:'name')
122
+ self.name = attributes[:'name']
123
+ end
124
+
125
+ if attributes.key?(:'repository')
126
+ self.repository = attributes[:'repository']
127
+ end
128
+
129
+ if attributes.key?(:'repository_version')
130
+ self.repository_version = attributes[:'repository_version']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ if @base_path.nil?
139
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
140
+ end
141
+
142
+ if @name.nil?
143
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ return false if @base_path.nil?
153
+ return false if @name.nil?
154
+ true
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ pulp_href == o.pulp_href &&
163
+ pulp_created == o.pulp_created &&
164
+ base_path == o.base_path &&
165
+ base_url == o.base_url &&
166
+ content_guard == o.content_guard &&
167
+ pulp_labels == o.pulp_labels &&
168
+ name == o.name &&
169
+ repository == o.repository &&
170
+ repository_version == o.repository_version
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, base_path, base_url, content_guard, pulp_labels, name, repository, repository_version].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
+ PulpOstreeClient.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