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