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,322 @@
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 OpenPGPDistribution
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::OpenPGPDistribution` 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::OpenPGPDistribution`. 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?
126
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
127
+ end
128
+
129
+ if @base_path.to_s.length < 1
130
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
131
+ end
132
+
133
+ if @name.nil?
134
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
135
+ end
136
+
137
+ if @name.to_s.length < 1
138
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
139
+ end
140
+
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ return false if @base_path.nil?
148
+ return false if @base_path.to_s.length < 1
149
+ return false if @name.nil?
150
+ return false if @name.to_s.length < 1
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] base_path Value to be assigned
156
+ def base_path=(base_path)
157
+ if base_path.nil?
158
+ fail ArgumentError, 'base_path cannot be nil'
159
+ end
160
+
161
+ if base_path.to_s.length < 1
162
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
163
+ end
164
+
165
+ @base_path = base_path
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] name Value to be assigned
170
+ def name=(name)
171
+ if name.nil?
172
+ fail ArgumentError, 'name cannot be nil'
173
+ end
174
+
175
+ if name.to_s.length < 1
176
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
177
+ end
178
+
179
+ @name = name
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if self.equal?(o)
186
+ self.class == o.class &&
187
+ base_path == o.base_path &&
188
+ content_guard == o.content_guard &&
189
+ hidden == o.hidden &&
190
+ pulp_labels == o.pulp_labels &&
191
+ name == o.name &&
192
+ repository == o.repository &&
193
+ repository_version == o.repository_version
194
+ end
195
+
196
+ # @see the `==` method
197
+ # @param [Object] Object to be compared
198
+ def eql?(o)
199
+ self == o
200
+ end
201
+
202
+ # Calculates hash code according to all attributes.
203
+ # @return [Integer] Hash code
204
+ def hash
205
+ [base_path, content_guard, hidden, pulp_labels, name, repository, repository_version].hash
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def self.build_from_hash(attributes)
212
+ new.build_from_hash(attributes)
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def build_from_hash(attributes)
219
+ return nil unless attributes.is_a?(Hash)
220
+ self.class.openapi_types.each_pair do |key, type|
221
+ if type =~ /\AArray<(.*)>/i
222
+ # check to ensure the input is an array given that the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
225
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
226
+ end
227
+ elsif !attributes[self.class.attribute_map[key]].nil?
228
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
229
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
230
+ end
231
+
232
+ self
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def _deserialize(type, value)
240
+ case type.to_sym
241
+ when :DateTime
242
+ DateTime.parse(value)
243
+ when :Date
244
+ Date.parse(value)
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :Boolean
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else # model
272
+ PulpcoreClient.const_get(type).build_from_hash(value)
273
+ end
274
+ end
275
+
276
+ # Returns the string representation of the object
277
+ # @return [String] String presentation of the object
278
+ def to_s
279
+ to_hash.to_s
280
+ end
281
+
282
+ # to_body is an alias to to_hash (backward compatibility)
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_body
285
+ to_hash
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ # Outputs non-array value in the form of hash
305
+ # For object, use to_hash. Otherwise, just return the value
306
+ # @param [Object] value Any valid value
307
+ # @return [Hash] Returns the value in the form of hash
308
+ def _to_hash(value)
309
+ if value.is_a?(Array)
310
+ value.compact.map { |v| _to_hash(v) }
311
+ elsif value.is_a?(Hash)
312
+ {}.tap do |hash|
313
+ value.each { |k, v| hash[k] = _to_hash(v) }
314
+ end
315
+ elsif value.respond_to? :to_hash
316
+ value.to_hash
317
+ else
318
+ value
319
+ end
320
+ end
321
+ end
322
+ end
@@ -0,0 +1,343 @@
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 OpenPGPDistributionResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # The Pulp Resource Name (PRN).
21
+ attr_accessor :prn
22
+
23
+ # Timestamp of creation.
24
+ attr_accessor :pulp_created
25
+
26
+ # 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.
27
+ attr_accessor :pulp_last_updated
28
+
29
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
30
+ attr_accessor :base_path
31
+
32
+ # The URL for accessing the publication as defined by this distribution.
33
+ attr_accessor :base_url
34
+
35
+ # An optional content-guard.
36
+ attr_accessor :content_guard
37
+
38
+ # Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.
39
+ attr_accessor :no_content_change_since
40
+
41
+ # Whether this distribution should be shown in the content app.
42
+ attr_accessor :hidden
43
+
44
+ attr_accessor :pulp_labels
45
+
46
+ # A unique name. Ex, `rawhide` and `stable`.
47
+ attr_accessor :name
48
+
49
+ # The latest RepositoryVersion for this Repository will be served.
50
+ attr_accessor :repository
51
+
52
+ # RepositoryVersion to be served
53
+ attr_accessor :repository_version
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'pulp_href' => :'pulp_href',
59
+ :'prn' => :'prn',
60
+ :'pulp_created' => :'pulp_created',
61
+ :'pulp_last_updated' => :'pulp_last_updated',
62
+ :'base_path' => :'base_path',
63
+ :'base_url' => :'base_url',
64
+ :'content_guard' => :'content_guard',
65
+ :'no_content_change_since' => :'no_content_change_since',
66
+ :'hidden' => :'hidden',
67
+ :'pulp_labels' => :'pulp_labels',
68
+ :'name' => :'name',
69
+ :'repository' => :'repository',
70
+ :'repository_version' => :'repository_version'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'pulp_href' => :'String',
78
+ :'prn' => :'String',
79
+ :'pulp_created' => :'DateTime',
80
+ :'pulp_last_updated' => :'DateTime',
81
+ :'base_path' => :'String',
82
+ :'base_url' => :'String',
83
+ :'content_guard' => :'String',
84
+ :'no_content_change_since' => :'String',
85
+ :'hidden' => :'Boolean',
86
+ :'pulp_labels' => :'Hash<String, String>',
87
+ :'name' => :'String',
88
+ :'repository' => :'String',
89
+ :'repository_version' => :'String'
90
+ }
91
+ end
92
+
93
+ # List of attributes with nullable: true
94
+ def self.openapi_nullable
95
+ Set.new([
96
+ :'content_guard',
97
+ :'repository',
98
+ :'repository_version'
99
+ ])
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::OpenPGPDistributionResponse` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!self.class.attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::OpenPGPDistributionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'pulp_href')
118
+ self.pulp_href = attributes[:'pulp_href']
119
+ end
120
+
121
+ if attributes.key?(:'prn')
122
+ self.prn = attributes[:'prn']
123
+ end
124
+
125
+ if attributes.key?(:'pulp_created')
126
+ self.pulp_created = attributes[:'pulp_created']
127
+ end
128
+
129
+ if attributes.key?(:'pulp_last_updated')
130
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
131
+ end
132
+
133
+ if attributes.key?(:'base_path')
134
+ self.base_path = attributes[:'base_path']
135
+ end
136
+
137
+ if attributes.key?(:'base_url')
138
+ self.base_url = attributes[:'base_url']
139
+ end
140
+
141
+ if attributes.key?(:'content_guard')
142
+ self.content_guard = attributes[:'content_guard']
143
+ end
144
+
145
+ if attributes.key?(:'no_content_change_since')
146
+ self.no_content_change_since = attributes[:'no_content_change_since']
147
+ end
148
+
149
+ if attributes.key?(:'hidden')
150
+ self.hidden = attributes[:'hidden']
151
+ else
152
+ self.hidden = false
153
+ end
154
+
155
+ if attributes.key?(:'pulp_labels')
156
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
157
+ self.pulp_labels = value
158
+ end
159
+ end
160
+
161
+ if attributes.key?(:'name')
162
+ self.name = attributes[:'name']
163
+ end
164
+
165
+ if attributes.key?(:'repository')
166
+ self.repository = attributes[:'repository']
167
+ end
168
+
169
+ if attributes.key?(:'repository_version')
170
+ self.repository_version = attributes[:'repository_version']
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ invalid_properties = Array.new
178
+ if @base_path.nil?
179
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
180
+ end
181
+
182
+ if @name.nil?
183
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
184
+ end
185
+
186
+ invalid_properties
187
+ end
188
+
189
+ # Check to see if the all the properties in the model are valid
190
+ # @return true if the model is valid
191
+ def valid?
192
+ return false if @base_path.nil?
193
+ return false if @name.nil?
194
+ true
195
+ end
196
+
197
+ # Checks equality by comparing each attribute.
198
+ # @param [Object] Object to be compared
199
+ def ==(o)
200
+ return true if self.equal?(o)
201
+ self.class == o.class &&
202
+ pulp_href == o.pulp_href &&
203
+ prn == o.prn &&
204
+ pulp_created == o.pulp_created &&
205
+ pulp_last_updated == o.pulp_last_updated &&
206
+ base_path == o.base_path &&
207
+ base_url == o.base_url &&
208
+ content_guard == o.content_guard &&
209
+ no_content_change_since == o.no_content_change_since &&
210
+ hidden == o.hidden &&
211
+ pulp_labels == o.pulp_labels &&
212
+ name == o.name &&
213
+ repository == o.repository &&
214
+ repository_version == o.repository_version
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [pulp_href, prn, pulp_created, pulp_last_updated, base_path, base_url, content_guard, no_content_change_since, hidden, pulp_labels, name, repository, repository_version].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ new.build_from_hash(attributes)
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ self.class.openapi_types.each_pair do |key, type|
242
+ if type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
246
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
247
+ end
248
+ elsif !attributes[self.class.attribute_map[key]].nil?
249
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
250
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
251
+ end
252
+
253
+ self
254
+ end
255
+
256
+ # Deserializes the data based on type
257
+ # @param string type Data type
258
+ # @param string value Value to be deserialized
259
+ # @return [Object] Deserialized data
260
+ def _deserialize(type, value)
261
+ case type.to_sym
262
+ when :DateTime
263
+ DateTime.parse(value)
264
+ when :Date
265
+ Date.parse(value)
266
+ when :String
267
+ value.to_s
268
+ when :Integer
269
+ value.to_i
270
+ when :Float
271
+ value.to_f
272
+ when :Boolean
273
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
274
+ true
275
+ else
276
+ false
277
+ end
278
+ when :Object
279
+ # generic object (usually a Hash), return directly
280
+ value
281
+ when /\AArray<(?<inner_type>.+)>\z/
282
+ inner_type = Regexp.last_match[:inner_type]
283
+ value.map { |v| _deserialize(inner_type, v) }
284
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
285
+ k_type = Regexp.last_match[:k_type]
286
+ v_type = Regexp.last_match[:v_type]
287
+ {}.tap do |hash|
288
+ value.each do |k, v|
289
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
290
+ end
291
+ end
292
+ else # model
293
+ PulpcoreClient.const_get(type).build_from_hash(value)
294
+ end
295
+ end
296
+
297
+ # Returns the string representation of the object
298
+ # @return [String] String presentation of the object
299
+ def to_s
300
+ to_hash.to_s
301
+ end
302
+
303
+ # to_body is an alias to to_hash (backward compatibility)
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_body
306
+ to_hash
307
+ end
308
+
309
+ # Returns the object in the form of hash
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_hash
312
+ hash = {}
313
+ self.class.attribute_map.each_pair do |attr, param|
314
+ value = self.send(attr)
315
+ if value.nil?
316
+ is_nullable = self.class.openapi_nullable.include?(attr)
317
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
+ end
319
+
320
+ hash[param] = _to_hash(value)
321
+ end
322
+ hash
323
+ end
324
+
325
+ # Outputs non-array value in the form of hash
326
+ # For object, use to_hash. Otherwise, just return the value
327
+ # @param [Object] value Any valid value
328
+ # @return [Hash] Returns the value in the form of hash
329
+ def _to_hash(value)
330
+ if value.is_a?(Array)
331
+ value.compact.map { |v| _to_hash(v) }
332
+ elsif value.is_a?(Hash)
333
+ {}.tap do |hash|
334
+ value.each { |k, v| hash[k] = _to_hash(v) }
335
+ end
336
+ elsif value.respond_to? :to_hash
337
+ value.to_hash
338
+ else
339
+ value
340
+ end
341
+ end
342
+ end
343
+ end