pulpcore_client 3.65.0 → 3.67.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +68 -4
  3. data/docs/AccessPoliciesApi.md +4 -4
  4. data/docs/ArtifactDistributionResponse.md +12 -12
  5. data/docs/ContentApi.md +4 -4
  6. data/docs/ContentOpenpgpPublickeyApi.md +212 -0
  7. data/docs/ContentOpenpgpPublicsubkeyApi.md +150 -0
  8. data/docs/ContentOpenpgpSignatureApi.md +150 -0
  9. data/docs/ContentOpenpgpUserattributeApi.md +150 -0
  10. data/docs/ContentOpenpgpUseridApi.md +166 -0
  11. data/docs/DistributionsApi.md +4 -4
  12. data/docs/DistributionsOpenpgpApi.md +478 -0
  13. data/docs/FilesystemExportResponse.md +1 -1
  14. data/docs/ImportResponse.md +1 -1
  15. data/docs/NestedOpenPGPPublicSubkey.md +19 -0
  16. data/docs/NestedOpenPGPPublicSubkeyResponse.md +21 -0
  17. data/docs/NestedOpenPGPSignature.md +27 -0
  18. data/docs/NestedOpenPGPSignatureResponse.md +29 -0
  19. data/docs/NestedOpenPGPUserAttribute.md +17 -0
  20. data/docs/NestedOpenPGPUserAttributeResponse.md +19 -0
  21. data/docs/NestedOpenPGPUserID.md +17 -0
  22. data/docs/NestedOpenPGPUserIDResponse.md +19 -0
  23. data/docs/OpenPGPDistribution.md +29 -0
  24. data/docs/OpenPGPDistributionResponse.md +41 -0
  25. data/docs/OpenPGPKeyring.md +25 -0
  26. data/docs/OpenPGPKeyringResponse.md +37 -0
  27. data/docs/OpenPGPPublicKey.md +23 -0
  28. data/docs/OpenPGPPublicKeyResponse.md +33 -0
  29. data/docs/OpenPGPPublicSubkeyResponse.md +31 -0
  30. data/docs/OpenPGPSignatureResponse.md +39 -0
  31. data/docs/OpenPGPUserAttributeResponse.md +29 -0
  32. data/docs/OpenPGPUserIDResponse.md +29 -0
  33. data/docs/PaginatedOpenPGPDistributionResponseList.md +23 -0
  34. data/docs/PaginatedOpenPGPKeyringResponseList.md +23 -0
  35. data/docs/PaginatedOpenPGPPublicKeyResponseList.md +23 -0
  36. data/docs/PaginatedOpenPGPPublicSubkeyResponseList.md +23 -0
  37. data/docs/PaginatedOpenPGPSignatureResponseList.md +23 -0
  38. data/docs/PaginatedOpenPGPUserAttributeResponseList.md +23 -0
  39. data/docs/PaginatedOpenPGPUserIDResponseList.md +23 -0
  40. data/docs/PatchedOpenPGPDistribution.md +29 -0
  41. data/docs/PatchedOpenPGPKeyring.md +25 -0
  42. data/docs/PulpExportResponse.md +3 -3
  43. data/docs/RepositoriesApi.md +4 -4
  44. data/docs/RepositoriesOpenpgpKeyringApi.md +802 -0
  45. data/docs/RepositoryAddRemoveContent.md +21 -0
  46. data/docs/SetLabel.md +19 -0
  47. data/docs/SetLabelResponse.md +19 -0
  48. data/docs/TaskResponse.md +1 -1
  49. data/docs/TasksApi.md +2 -2
  50. data/docs/UnsetLabel.md +17 -0
  51. data/docs/UnsetLabelResponse.md +19 -0
  52. data/lib/pulpcore_client/api/access_policies_api.rb +8 -8
  53. data/lib/pulpcore_client/api/content_api.rb +6 -6
  54. data/lib/pulpcore_client/api/content_openpgp_publickey_api.rb +266 -0
  55. data/lib/pulpcore_client/api/content_openpgp_publicsubkey_api.rb +192 -0
  56. data/lib/pulpcore_client/api/content_openpgp_signature_api.rb +192 -0
  57. data/lib/pulpcore_client/api/content_openpgp_userattribute_api.rb +192 -0
  58. data/lib/pulpcore_client/api/content_openpgp_userid_api.rb +216 -0
  59. data/lib/pulpcore_client/api/distributions_api.rb +6 -6
  60. data/lib/pulpcore_client/api/distributions_openpgp_api.rb +592 -0
  61. data/lib/pulpcore_client/api/repositories_api.rb +6 -6
  62. data/lib/pulpcore_client/api/repositories_openpgp_keyring_api.rb +992 -0
  63. data/lib/pulpcore_client/api/tasks_api.rb +3 -3
  64. data/lib/pulpcore_client/models/artifact_distribution_response.rb +58 -58
  65. data/lib/pulpcore_client/models/filesystem_export_response.rb +1 -1
  66. data/lib/pulpcore_client/models/import_response.rb +1 -1
  67. data/lib/pulpcore_client/models/nested_open_pgp_public_subkey.rb +254 -0
  68. data/lib/pulpcore_client/models/nested_open_pgp_public_subkey_response.rb +256 -0
  69. data/lib/pulpcore_client/models/nested_open_pgp_signature.rb +305 -0
  70. data/lib/pulpcore_client/models/nested_open_pgp_signature_response.rb +290 -0
  71. data/lib/pulpcore_client/models/nested_open_pgp_user_attribute.rb +240 -0
  72. data/lib/pulpcore_client/models/nested_open_pgp_user_attribute_response.rb +242 -0
  73. data/lib/pulpcore_client/models/nested_open_pgp_user_id.rb +231 -0
  74. data/lib/pulpcore_client/models/nested_open_pgp_user_id_response.rb +223 -0
  75. data/lib/pulpcore_client/models/open_pgp_distribution.rb +322 -0
  76. data/lib/pulpcore_client/models/open_pgp_distribution_response.rb +343 -0
  77. data/lib/pulpcore_client/models/open_pgp_keyring.rb +306 -0
  78. data/lib/pulpcore_client/models/open_pgp_keyring_response.rb +329 -0
  79. data/lib/pulpcore_client/models/open_pgp_public_key.rb +253 -0
  80. data/lib/pulpcore_client/models/open_pgp_public_key_response.rb +303 -0
  81. data/lib/pulpcore_client/models/open_pgp_public_subkey_response.rb +304 -0
  82. data/lib/pulpcore_client/models/open_pgp_signature_response.rb +338 -0
  83. data/lib/pulpcore_client/models/open_pgp_user_attribute_response.rb +290 -0
  84. data/lib/pulpcore_client/models/open_pgp_user_id_response.rb +271 -0
  85. data/lib/pulpcore_client/models/paginated_open_pgp_distribution_response_list.rb +247 -0
  86. data/lib/pulpcore_client/models/paginated_open_pgp_keyring_response_list.rb +247 -0
  87. data/lib/pulpcore_client/models/paginated_open_pgp_public_key_response_list.rb +247 -0
  88. data/lib/pulpcore_client/models/paginated_open_pgp_public_subkey_response_list.rb +247 -0
  89. data/lib/pulpcore_client/models/paginated_open_pgp_signature_response_list.rb +247 -0
  90. data/lib/pulpcore_client/models/paginated_open_pgp_user_attribute_response_list.rb +247 -0
  91. data/lib/pulpcore_client/models/paginated_open_pgp_user_id_response_list.rb +247 -0
  92. data/lib/pulpcore_client/models/patched_open_pgp_distribution.rb +304 -0
  93. data/lib/pulpcore_client/models/patched_open_pgp_keyring.rb +297 -0
  94. data/lib/pulpcore_client/models/pulp_export_response.rb +3 -3
  95. data/lib/pulpcore_client/models/repository_add_remove_content.rb +232 -0
  96. data/lib/pulpcore_client/models/set_label.rb +252 -0
  97. data/lib/pulpcore_client/models/set_label_response.rb +243 -0
  98. data/lib/pulpcore_client/models/task_response.rb +1 -1
  99. data/lib/pulpcore_client/models/unset_label.rb +242 -0
  100. data/lib/pulpcore_client/models/unset_label_response.rb +242 -0
  101. data/lib/pulpcore_client/version.rb +1 -1
  102. data/lib/pulpcore_client.rb +39 -0
  103. data/spec/api/access_policies_api_spec.rb +4 -4
  104. data/spec/api/content_api_spec.rb +2 -2
  105. data/spec/api/content_openpgp_publickey_api_spec.rb +89 -0
  106. data/spec/api/content_openpgp_publicsubkey_api_spec.rb +74 -0
  107. data/spec/api/content_openpgp_signature_api_spec.rb +74 -0
  108. data/spec/api/content_openpgp_userattribute_api_spec.rb +74 -0
  109. data/spec/api/content_openpgp_userid_api_spec.rb +82 -0
  110. data/spec/api/distributions_api_spec.rb +2 -2
  111. data/spec/api/distributions_openpgp_api_spec.rb +148 -0
  112. data/spec/api/repositories_api_spec.rb +2 -2
  113. data/spec/api/repositories_openpgp_keyring_api_spec.rb +233 -0
  114. data/spec/api/tasks_api_spec.rb +1 -1
  115. data/spec/models/artifact_distribution_response_spec.rb +10 -10
  116. data/spec/models/nested_open_pgp_public_subkey_response_spec.rb +53 -0
  117. data/spec/models/nested_open_pgp_public_subkey_spec.rb +47 -0
  118. data/spec/models/nested_open_pgp_signature_response_spec.rb +77 -0
  119. data/spec/models/nested_open_pgp_signature_spec.rb +71 -0
  120. data/spec/models/nested_open_pgp_user_attribute_response_spec.rb +47 -0
  121. data/spec/models/nested_open_pgp_user_attribute_spec.rb +41 -0
  122. data/spec/models/nested_open_pgp_user_id_response_spec.rb +47 -0
  123. data/spec/models/nested_open_pgp_user_id_spec.rb +41 -0
  124. data/spec/models/open_pgp_distribution_response_spec.rb +113 -0
  125. data/spec/models/open_pgp_distribution_spec.rb +77 -0
  126. data/spec/models/open_pgp_keyring_response_spec.rb +101 -0
  127. data/spec/models/open_pgp_keyring_spec.rb +65 -0
  128. data/spec/models/open_pgp_public_key_response_spec.rb +89 -0
  129. data/spec/models/open_pgp_public_key_spec.rb +59 -0
  130. data/spec/models/open_pgp_public_subkey_response_spec.rb +83 -0
  131. data/spec/models/open_pgp_signature_response_spec.rb +107 -0
  132. data/spec/models/open_pgp_user_attribute_response_spec.rb +77 -0
  133. data/spec/models/open_pgp_user_id_response_spec.rb +77 -0
  134. data/spec/models/paginated_open_pgp_distribution_response_list_spec.rb +59 -0
  135. data/spec/models/paginated_open_pgp_keyring_response_list_spec.rb +59 -0
  136. data/spec/models/paginated_open_pgp_public_key_response_list_spec.rb +59 -0
  137. data/spec/models/paginated_open_pgp_public_subkey_response_list_spec.rb +59 -0
  138. data/spec/models/paginated_open_pgp_signature_response_list_spec.rb +59 -0
  139. data/spec/models/paginated_open_pgp_user_attribute_response_list_spec.rb +59 -0
  140. data/spec/models/paginated_open_pgp_user_id_response_list_spec.rb +59 -0
  141. data/spec/models/patched_open_pgp_distribution_spec.rb +77 -0
  142. data/spec/models/patched_open_pgp_keyring_spec.rb +65 -0
  143. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  144. data/spec/models/set_label_response_spec.rb +47 -0
  145. data/spec/models/set_label_spec.rb +47 -0
  146. data/spec/models/unset_label_response_spec.rb +47 -0
  147. data/spec/models/unset_label_spec.rb +41 -0
  148. metadata +311 -155
@@ -0,0 +1,247 @@
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 PulpcoreClient
16
+ class PaginatedOpenPGPUserIDResponseList
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<OpenPGPUserIDResponse>'
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 `PulpcoreClient::PaginatedOpenPGPUserIDResponseList` 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 `PulpcoreClient::PaginatedOpenPGPUserIDResponseList`. 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
+ if @count.nil?
92
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
93
+ end
94
+
95
+ if @results.nil?
96
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @count.nil?
106
+ return false if @results.nil?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ count == o.count &&
116
+ _next == o._next &&
117
+ previous == o.previous &&
118
+ results == o.results
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [count, _next, previous, results].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.openapi_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ PulpcoreClient.const_get(type).build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+ end
247
+ end
@@ -0,0 +1,304 @@
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 PulpcoreClient
16
+ # The Serializer for the Distribution model. The serializer deliberately omits the `publication` and `repository_version` field due to plugins typically requiring one or the other but not both. To include the ``publication`` field, it is recommended plugins define the field:: publication = DetailRelatedField( required=False, help_text=_(\"Publication to be served\"), view_name_pattern=r\"publications(-.*/.*)?-detail\", queryset=models.Publication.objects.exclude(complete=False), allow_null=True, ) To include the ``repository_version`` field, it is recommended plugins define the field:: repository_version = RepositoryVersionRelatedField( required=False, help_text=_(\"RepositoryVersion to be served\"), allow_null=True ) Additionally, the serializer omits the ``remote`` field, which is used for pull-through caching feature and only by plugins which use publications. Plugins implementing a pull-through caching should define the field in their derived serializer class like this:: remote = DetailRelatedField( required=False, help_text=_('Remote that can be used to fetch content when using pull-through caching.'), queryset=models.Remote.objects.all(), allow_null=True )
17
+ class PatchedOpenPGPDistribution
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
+ # Whether this distribution should be shown in the content app.
25
+ attr_accessor :hidden
26
+
27
+ attr_accessor :pulp_labels
28
+
29
+ # A unique name. Ex, `rawhide` and `stable`.
30
+ attr_accessor :name
31
+
32
+ # The latest RepositoryVersion for this Repository will be served.
33
+ attr_accessor :repository
34
+
35
+ # RepositoryVersion to be served
36
+ attr_accessor :repository_version
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'base_path' => :'base_path',
42
+ :'content_guard' => :'content_guard',
43
+ :'hidden' => :'hidden',
44
+ :'pulp_labels' => :'pulp_labels',
45
+ :'name' => :'name',
46
+ :'repository' => :'repository',
47
+ :'repository_version' => :'repository_version'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'base_path' => :'String',
55
+ :'content_guard' => :'String',
56
+ :'hidden' => :'Boolean',
57
+ :'pulp_labels' => :'Hash<String, String>',
58
+ :'name' => :'String',
59
+ :'repository' => :'String',
60
+ :'repository_version' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'content_guard',
68
+ :'repository',
69
+ :'repository_version'
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PatchedOpenPGPDistribution` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PatchedOpenPGPDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'base_path')
89
+ self.base_path = attributes[:'base_path']
90
+ end
91
+
92
+ if attributes.key?(:'content_guard')
93
+ self.content_guard = attributes[:'content_guard']
94
+ end
95
+
96
+ if attributes.key?(:'hidden')
97
+ self.hidden = attributes[:'hidden']
98
+ else
99
+ self.hidden = false
100
+ end
101
+
102
+ if attributes.key?(:'pulp_labels')
103
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
104
+ self.pulp_labels = value
105
+ end
106
+ end
107
+
108
+ if attributes.key?(:'name')
109
+ self.name = attributes[:'name']
110
+ end
111
+
112
+ if attributes.key?(:'repository')
113
+ self.repository = attributes[:'repository']
114
+ end
115
+
116
+ if attributes.key?(:'repository_version')
117
+ self.repository_version = attributes[:'repository_version']
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ if !@base_path.nil? && @base_path.to_s.length < 1
126
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
127
+ end
128
+
129
+ if !@name.nil? && @name.to_s.length < 1
130
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ return false if !@base_path.nil? && @base_path.to_s.length < 1
140
+ return false if !@name.nil? && @name.to_s.length < 1
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] base_path Value to be assigned
146
+ def base_path=(base_path)
147
+ if !base_path.nil? && base_path.to_s.length < 1
148
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
149
+ end
150
+
151
+ @base_path = base_path
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] name Value to be assigned
156
+ def name=(name)
157
+ if !name.nil? && name.to_s.length < 1
158
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
159
+ end
160
+
161
+ @name = name
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ base_path == o.base_path &&
170
+ content_guard == o.content_guard &&
171
+ hidden == o.hidden &&
172
+ pulp_labels == o.pulp_labels &&
173
+ name == o.name &&
174
+ repository == o.repository &&
175
+ repository_version == o.repository_version
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [base_path, content_guard, hidden, pulp_labels, name, repository, repository_version].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ new.build_from_hash(attributes)
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ self.class.openapi_types.each_pair do |key, type|
203
+ if type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
207
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
208
+ end
209
+ elsif !attributes[self.class.attribute_map[key]].nil?
210
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
212
+ end
213
+
214
+ self
215
+ end
216
+
217
+ # Deserializes the data based on type
218
+ # @param string type Data type
219
+ # @param string value Value to be deserialized
220
+ # @return [Object] Deserialized data
221
+ def _deserialize(type, value)
222
+ case type.to_sym
223
+ when :DateTime
224
+ DateTime.parse(value)
225
+ when :Date
226
+ Date.parse(value)
227
+ when :String
228
+ value.to_s
229
+ when :Integer
230
+ value.to_i
231
+ when :Float
232
+ value.to_f
233
+ when :Boolean
234
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
+ true
236
+ else
237
+ false
238
+ end
239
+ when :Object
240
+ # generic object (usually a Hash), return directly
241
+ value
242
+ when /\AArray<(?<inner_type>.+)>\z/
243
+ inner_type = Regexp.last_match[:inner_type]
244
+ value.map { |v| _deserialize(inner_type, v) }
245
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
+ k_type = Regexp.last_match[:k_type]
247
+ v_type = Regexp.last_match[:v_type]
248
+ {}.tap do |hash|
249
+ value.each do |k, v|
250
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
251
+ end
252
+ end
253
+ else # model
254
+ PulpcoreClient.const_get(type).build_from_hash(value)
255
+ end
256
+ end
257
+
258
+ # Returns the string representation of the object
259
+ # @return [String] String presentation of the object
260
+ def to_s
261
+ to_hash.to_s
262
+ end
263
+
264
+ # to_body is an alias to to_hash (backward compatibility)
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_body
267
+ to_hash
268
+ end
269
+
270
+ # Returns the object in the form of hash
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_hash
273
+ hash = {}
274
+ self.class.attribute_map.each_pair do |attr, param|
275
+ value = self.send(attr)
276
+ if value.nil?
277
+ is_nullable = self.class.openapi_nullable.include?(attr)
278
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
+ end
280
+
281
+ hash[param] = _to_hash(value)
282
+ end
283
+ hash
284
+ end
285
+
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+ end
304
+ end