pulpcore_client 3.65.0 → 3.66.0

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