pulp_ansible_client 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -4
  3. data/docs/AnsibleCollectionRemote.md +3 -1
  4. data/docs/AnsibleCollectionRemoteResponse.md +3 -1
  5. data/docs/AnsibleCollectionVersionResponse.md +4 -4
  6. data/docs/AnsibleCollectionVersionSignatureResponse.md +25 -0
  7. data/docs/AnsibleGitRemote.md +27 -27
  8. data/docs/AnsibleGitRemoteResponse.md +26 -26
  9. data/docs/AnsibleRepositorySignature.md +19 -0
  10. data/docs/AnsibleRoleResponse.md +4 -4
  11. data/docs/CollectionVersionResponse.md +2 -0
  12. data/docs/ContentCollectionSignaturesApi.md +146 -0
  13. data/docs/PaginatedansibleCollectionVersionSignatureResponseList.md +23 -0
  14. data/docs/PatchedansibleCollectionRemote.md +3 -1
  15. data/docs/PatchedansibleGitRemote.md +27 -27
  16. data/docs/RepositoriesAnsibleApi.md +55 -0
  17. data/docs/UnpaginatedCollectionVersionResponse.md +2 -0
  18. data/lib/pulp_ansible_client/api/content_collection_signatures_api.rb +182 -0
  19. data/lib/pulp_ansible_client/api/repositories_ansible_api.rb +68 -0
  20. data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +18 -5
  21. data/lib/pulp_ansible_client/models/ansible_collection_remote_response.rb +18 -5
  22. data/lib/pulp_ansible_client/models/ansible_collection_version_response.rb +14 -14
  23. data/lib/pulp_ansible_client/models/ansible_collection_version_signature_response.rb +258 -0
  24. data/lib/pulp_ansible_client/models/ansible_git_remote.rb +233 -233
  25. data/lib/pulp_ansible_client/models/ansible_git_remote_response.rb +148 -148
  26. data/lib/pulp_ansible_client/models/ansible_repository_signature.rb +230 -0
  27. data/lib/pulp_ansible_client/models/ansible_role_response.rb +14 -14
  28. data/lib/pulp_ansible_client/models/collection_version_response.rb +10 -1
  29. data/lib/pulp_ansible_client/models/paginatedansible_collection_version_signature_response_list.rb +237 -0
  30. data/lib/pulp_ansible_client/models/patchedansible_collection_remote.rb +18 -5
  31. data/lib/pulp_ansible_client/models/patchedansible_git_remote.rb +224 -224
  32. data/lib/pulp_ansible_client/models/unpaginated_collection_version_response.rb +10 -1
  33. data/lib/pulp_ansible_client/version.rb +1 -1
  34. data/lib/pulp_ansible_client.rb +4 -0
  35. data/pulp_ansible_client.gemspec +1 -1
  36. data/spec/api/content_collection_signatures_api_spec.rb +72 -0
  37. data/spec/api/repositories_ansible_api_spec.rb +12 -0
  38. data/spec/models/ansible_collection_remote_response_spec.rb +6 -0
  39. data/spec/models/ansible_collection_remote_spec.rb +6 -0
  40. data/spec/models/ansible_collection_version_response_spec.rb +2 -2
  41. data/spec/models/ansible_collection_version_signature_response_spec.rb +65 -0
  42. data/spec/models/ansible_git_remote_response_spec.rb +18 -18
  43. data/spec/models/ansible_git_remote_spec.rb +19 -19
  44. data/spec/models/ansible_repository_signature_spec.rb +47 -0
  45. data/spec/models/ansible_role_response_spec.rb +2 -2
  46. data/spec/models/collection_version_response_spec.rb +6 -0
  47. data/spec/models/paginatedansible_collection_version_signature_response_list_spec.rb +59 -0
  48. data/spec/models/patchedansible_collection_remote_spec.rb +6 -0
  49. data/spec/models/patchedansible_git_remote_spec.rb +19 -19
  50. data/spec/models/unpaginated_collection_version_response_spec.rb +6 -0
  51. metadata +100 -78
@@ -0,0 +1,258 @@
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 PulpAnsibleClient
16
+ # A serializer for signature models.
17
+ class AnsibleCollectionVersionSignatureResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # The content this signature is pointing to.
24
+ attr_accessor :signed_collection
25
+
26
+ # The fingerprint of the public key.
27
+ attr_accessor :pubkey_fingerprint
28
+
29
+ # The signing service used to create the signature.
30
+ attr_accessor :signing_service
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'pulp_href' => :'pulp_href',
36
+ :'pulp_created' => :'pulp_created',
37
+ :'signed_collection' => :'signed_collection',
38
+ :'pubkey_fingerprint' => :'pubkey_fingerprint',
39
+ :'signing_service' => :'signing_service'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'pulp_href' => :'String',
47
+ :'pulp_created' => :'DateTime',
48
+ :'signed_collection' => :'String',
49
+ :'pubkey_fingerprint' => :'String',
50
+ :'signing_service' => :'String'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ :'signing_service'
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::AnsibleCollectionVersionSignatureResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::AnsibleCollectionVersionSignatureResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'pulp_href')
77
+ self.pulp_href = attributes[:'pulp_href']
78
+ end
79
+
80
+ if attributes.key?(:'pulp_created')
81
+ self.pulp_created = attributes[:'pulp_created']
82
+ end
83
+
84
+ if attributes.key?(:'signed_collection')
85
+ self.signed_collection = attributes[:'signed_collection']
86
+ end
87
+
88
+ if attributes.key?(:'pubkey_fingerprint')
89
+ self.pubkey_fingerprint = attributes[:'pubkey_fingerprint']
90
+ end
91
+
92
+ if attributes.key?(:'signing_service')
93
+ self.signing_service = attributes[:'signing_service']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @signed_collection.nil?
102
+ invalid_properties.push('invalid value for "signed_collection", signed_collection cannot be nil.')
103
+ end
104
+
105
+ if @pubkey_fingerprint.nil?
106
+ invalid_properties.push('invalid value for "pubkey_fingerprint", pubkey_fingerprint cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @signed_collection.nil?
116
+ return false if @pubkey_fingerprint.nil?
117
+ true
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
+ pulp_href == o.pulp_href &&
126
+ pulp_created == o.pulp_created &&
127
+ signed_collection == o.signed_collection &&
128
+ pubkey_fingerprint == o.pubkey_fingerprint &&
129
+ signing_service == o.signing_service
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [pulp_href, pulp_created, signed_collection, pubkey_fingerprint, signing_service].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.openapi_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ PulpAnsibleClient.const_get(type).build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+ end
258
+ end