pulp_ansible_client 0.2.0b14 → 0.2.0b15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -20
  3. data/docs/{AnsibleCollectionRead.md → AnsibleCollection.md} +2 -2
  4. data/docs/AnsibleCollectionRemote.md +5 -1
  5. data/docs/AnsibleCollectionVersion.md +3 -3
  6. data/docs/AnsibleRole.md +3 -3
  7. data/docs/{CollectionImportDetailRead.md → CollectionImportDetail.md} +2 -2
  8. data/docs/ContentCollectionVersionsApi.md +4 -4
  9. data/docs/ContentRolesApi.md +4 -4
  10. data/docs/DistributionsAnsibleApi.md +2 -2
  11. data/docs/{GalaxyCollectionVersionRead.md → GalaxyCollectionVersion.md} +2 -2
  12. data/docs/{GalaxyRoleRead.md → GalaxyRole.md} +2 -2
  13. data/docs/{GalaxyRoleVersionRead.md → GalaxyRoleVersion.md} +2 -2
  14. data/docs/InlineResponse200.md +1 -1
  15. data/docs/InlineResponse2001.md +1 -1
  16. data/docs/InlineResponse20010.md +1 -1
  17. data/docs/InlineResponse20011.md +1 -1
  18. data/docs/InlineResponse20012.md +1 -1
  19. data/docs/InlineResponse20013.md +1 -1
  20. data/docs/InlineResponse2002.md +1 -1
  21. data/docs/InlineResponse2003.md +1 -1
  22. data/docs/InlineResponse2004.md +1 -1
  23. data/docs/InlineResponse2005.md +1 -1
  24. data/docs/InlineResponse2006.md +1 -1
  25. data/docs/InlineResponse2007.md +1 -1
  26. data/docs/InlineResponse2008.md +1 -1
  27. data/docs/InlineResponse2009.md +1 -1
  28. data/docs/PulpAnsibleGalaxyApiCollectionsApi.md +4 -4
  29. data/docs/PulpAnsibleGalaxyApiV3CollectionsApi.md +2 -2
  30. data/docs/RemotesAnsibleApi.md +4 -4
  31. data/docs/RemotesCollectionApi.md +4 -4
  32. data/docs/RepositoriesAnsibleApi.md +4 -4
  33. data/docs/RepositoriesAnsibleVersionsApi.md +6 -4
  34. data/docs/{TagRead.md → Tag.md} +2 -2
  35. data/lib/pulp_ansible_client/api/content_collection_versions_api.rb +6 -6
  36. data/lib/pulp_ansible_client/api/content_roles_api.rb +6 -6
  37. data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +3 -3
  38. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb +6 -6
  39. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v3_collections_api.rb +3 -3
  40. data/lib/pulp_ansible_client/api/remotes_ansible_api.rb +6 -6
  41. data/lib/pulp_ansible_client/api/remotes_collection_api.rb +6 -6
  42. data/lib/pulp_ansible_client/api/repositories_ansible_api.rb +6 -6
  43. data/lib/pulp_ansible_client/api/repositories_ansible_versions_api.rb +9 -6
  44. data/lib/pulp_ansible_client/models/{ansible_collection_read.rb → ansible_collection.rb} +3 -3
  45. data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +75 -5
  46. data/lib/pulp_ansible_client/models/ansible_collection_version.rb +11 -11
  47. data/lib/pulp_ansible_client/models/ansible_role.rb +11 -11
  48. data/lib/pulp_ansible_client/models/{collection_import_detail_read.rb → collection_import_detail.rb} +3 -3
  49. data/lib/pulp_ansible_client/models/{galaxy_collection_version_read.rb → galaxy_collection_version.rb} +3 -3
  50. data/lib/pulp_ansible_client/models/{galaxy_role_read.rb → galaxy_role.rb} +3 -3
  51. data/lib/pulp_ansible_client/models/{galaxy_role_version_read.rb → galaxy_role_version.rb} +3 -3
  52. data/lib/pulp_ansible_client/models/inline_response200.rb +1 -1
  53. data/lib/pulp_ansible_client/models/inline_response2001.rb +1 -1
  54. data/lib/pulp_ansible_client/models/inline_response20010.rb +1 -1
  55. data/lib/pulp_ansible_client/models/inline_response20011.rb +1 -1
  56. data/lib/pulp_ansible_client/models/inline_response20012.rb +1 -1
  57. data/lib/pulp_ansible_client/models/inline_response20013.rb +1 -1
  58. data/lib/pulp_ansible_client/models/inline_response2002.rb +1 -1
  59. data/lib/pulp_ansible_client/models/inline_response2003.rb +1 -1
  60. data/lib/pulp_ansible_client/models/inline_response2004.rb +1 -1
  61. data/lib/pulp_ansible_client/models/inline_response2005.rb +1 -1
  62. data/lib/pulp_ansible_client/models/inline_response2006.rb +1 -1
  63. data/lib/pulp_ansible_client/models/inline_response2007.rb +1 -1
  64. data/lib/pulp_ansible_client/models/inline_response2008.rb +1 -1
  65. data/lib/pulp_ansible_client/models/inline_response2009.rb +1 -1
  66. data/lib/pulp_ansible_client/models/{tag_read.rb → tag.rb} +3 -3
  67. data/lib/pulp_ansible_client/version.rb +1 -1
  68. data/lib/pulp_ansible_client.rb +6 -16
  69. data/spec/api/content_collection_versions_api_spec.rb +2 -2
  70. data/spec/api/content_roles_api_spec.rb +2 -2
  71. data/spec/api/distributions_ansible_api_spec.rb +1 -1
  72. data/spec/api/pulp_ansible_galaxy_api_collections_api_spec.rb +2 -2
  73. data/spec/api/pulp_ansible_galaxy_api_v3_collections_api_spec.rb +1 -1
  74. data/spec/api/remotes_ansible_api_spec.rb +2 -2
  75. data/spec/api/remotes_collection_api_spec.rb +2 -2
  76. data/spec/api/repositories_ansible_api_spec.rb +2 -2
  77. data/spec/api/repositories_ansible_versions_api_spec.rb +3 -2
  78. data/spec/models/ansible_collection_remote_spec.rb +12 -0
  79. data/spec/models/{ansible_collection_read_spec.rb → ansible_collection_spec.rb} +6 -6
  80. data/spec/models/ansible_collection_version_spec.rb +3 -3
  81. data/spec/models/ansible_role_spec.rb +3 -3
  82. data/spec/models/{collection_import_detail_read_spec.rb → collection_import_detail_spec.rb} +6 -6
  83. data/spec/models/{galaxy_collection_version_read_spec.rb → galaxy_collection_version_spec.rb} +6 -6
  84. data/spec/models/{galaxy_role_read_spec.rb → galaxy_role_spec.rb} +6 -6
  85. data/spec/models/{galaxy_role_version_read_spec.rb → galaxy_role_version_spec.rb} +6 -6
  86. data/spec/models/{tag_read_spec.rb → tag_spec.rb} +6 -6
  87. metadata +26 -66
  88. data/docs/AnsibleAnsibleDistributionRead.md +0 -31
  89. data/docs/AnsibleAnsibleRemoteRead.md +0 -43
  90. data/docs/AnsibleAnsibleRepositoryRead.md +0 -27
  91. data/docs/AnsibleCollectionRemoteRead.md +0 -45
  92. data/docs/AnsibleCollectionVersionRead.md +0 -67
  93. data/docs/AnsibleRoleRead.md +0 -27
  94. data/docs/CollectionRead.md +0 -31
  95. data/docs/CollectionVersionRead.md +0 -37
  96. data/docs/GalaxyCollectionRead.md +0 -23
  97. data/docs/RepositoryVersionRead.md +0 -25
  98. data/lib/pulp_ansible_client/models/ansible_ansible_distribution_read.rb +0 -327
  99. data/lib/pulp_ansible_client/models/ansible_ansible_remote_read.rb +0 -531
  100. data/lib/pulp_ansible_client/models/ansible_ansible_repository_read.rb +0 -294
  101. data/lib/pulp_ansible_client/models/ansible_collection_remote_read.rb +0 -557
  102. data/lib/pulp_ansible_client/models/ansible_collection_version_read.rb +0 -816
  103. data/lib/pulp_ansible_client/models/ansible_role_read.rb +0 -330
  104. data/lib/pulp_ansible_client/models/collection_read.rb +0 -314
  105. data/lib/pulp_ansible_client/models/collection_version_read.rb +0 -370
  106. data/lib/pulp_ansible_client/models/galaxy_collection_read.rb +0 -281
  107. data/lib/pulp_ansible_client/models/repository_version_read.rb +0 -244
  108. data/spec/models/ansible_ansible_distribution_read_spec.rb +0 -83
  109. data/spec/models/ansible_ansible_remote_read_spec.rb +0 -123
  110. data/spec/models/ansible_ansible_repository_read_spec.rb +0 -71
  111. data/spec/models/ansible_collection_remote_read_spec.rb +0 -129
  112. data/spec/models/ansible_collection_version_read_spec.rb +0 -191
  113. data/spec/models/ansible_role_read_spec.rb +0 -71
  114. data/spec/models/collection_read_spec.rb +0 -83
  115. data/spec/models/collection_version_read_spec.rb +0 -105
  116. data/spec/models/galaxy_collection_read_spec.rb +0 -59
  117. data/spec/models/repository_version_read_spec.rb +0 -65
@@ -1,330 +0,0 @@
1
- =begin
2
- #Pulp 3 API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: v3
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PulpAnsibleClient
16
- class AnsibleRoleRead
17
- attr_accessor :pulp_href
18
-
19
- # Artifact file representing the physical content
20
- attr_accessor :artifact
21
-
22
- # Timestamp of creation.
23
- attr_accessor :pulp_created
24
-
25
- attr_accessor :version
26
-
27
- attr_accessor :name
28
-
29
- attr_accessor :namespace
30
-
31
- # Attribute mapping from ruby-style variable name to JSON key.
32
- def self.attribute_map
33
- {
34
- :'pulp_href' => :'pulp_href',
35
- :'artifact' => :'artifact',
36
- :'pulp_created' => :'pulp_created',
37
- :'version' => :'version',
38
- :'name' => :'name',
39
- :'namespace' => :'namespace'
40
- }
41
- end
42
-
43
- # Attribute type mapping.
44
- def self.openapi_types
45
- {
46
- :'pulp_href' => :'String',
47
- :'artifact' => :'String',
48
- :'pulp_created' => :'DateTime',
49
- :'version' => :'String',
50
- :'name' => :'String',
51
- :'namespace' => :'String'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
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::AnsibleRoleRead` 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::AnsibleRoleRead`. 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?(:'artifact')
81
- self.artifact = attributes[:'artifact']
82
- end
83
-
84
- if attributes.key?(:'pulp_created')
85
- self.pulp_created = attributes[:'pulp_created']
86
- end
87
-
88
- if attributes.key?(:'version')
89
- self.version = attributes[:'version']
90
- end
91
-
92
- if attributes.key?(:'name')
93
- self.name = attributes[:'name']
94
- end
95
-
96
- if attributes.key?(:'namespace')
97
- self.namespace = attributes[:'namespace']
98
- end
99
- end
100
-
101
- # Show invalid properties with the reasons. Usually used together with valid?
102
- # @return Array for valid properties with the reasons
103
- def list_invalid_properties
104
- invalid_properties = Array.new
105
- if @artifact.nil?
106
- invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
107
- end
108
-
109
- if @version.nil?
110
- invalid_properties.push('invalid value for "version", version cannot be nil.')
111
- end
112
-
113
- if @version.to_s.length < 1
114
- invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
115
- end
116
-
117
- if @name.nil?
118
- invalid_properties.push('invalid value for "name", name cannot be nil.')
119
- end
120
-
121
- if @name.to_s.length < 1
122
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
123
- end
124
-
125
- if @namespace.nil?
126
- invalid_properties.push('invalid value for "namespace", namespace cannot be nil.')
127
- end
128
-
129
- if @namespace.to_s.length < 1
130
- invalid_properties.push('invalid value for "namespace", the character length must be great than or equal to 1.')
131
- end
132
-
133
- invalid_properties
134
- end
135
-
136
- # Check to see if the all the properties in the model are valid
137
- # @return true if the model is valid
138
- def valid?
139
- return false if @artifact.nil?
140
- return false if @version.nil?
141
- return false if @version.to_s.length < 1
142
- return false if @name.nil?
143
- return false if @name.to_s.length < 1
144
- return false if @namespace.nil?
145
- return false if @namespace.to_s.length < 1
146
- true
147
- end
148
-
149
- # Custom attribute writer method with validation
150
- # @param [Object] version Value to be assigned
151
- def version=(version)
152
- if version.nil?
153
- fail ArgumentError, 'version cannot be nil'
154
- end
155
-
156
- if version.to_s.length < 1
157
- fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
158
- end
159
-
160
- @version = version
161
- end
162
-
163
- # Custom attribute writer method with validation
164
- # @param [Object] name Value to be assigned
165
- def name=(name)
166
- if name.nil?
167
- fail ArgumentError, 'name cannot be nil'
168
- end
169
-
170
- if name.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
172
- end
173
-
174
- @name = name
175
- end
176
-
177
- # Custom attribute writer method with validation
178
- # @param [Object] namespace Value to be assigned
179
- def namespace=(namespace)
180
- if namespace.nil?
181
- fail ArgumentError, 'namespace cannot be nil'
182
- end
183
-
184
- if namespace.to_s.length < 1
185
- fail ArgumentError, 'invalid value for "namespace", the character length must be great than or equal to 1.'
186
- end
187
-
188
- @namespace = namespace
189
- end
190
-
191
- # Checks equality by comparing each attribute.
192
- # @param [Object] Object to be compared
193
- def ==(o)
194
- return true if self.equal?(o)
195
- self.class == o.class &&
196
- pulp_href == o.pulp_href &&
197
- artifact == o.artifact &&
198
- pulp_created == o.pulp_created &&
199
- version == o.version &&
200
- name == o.name &&
201
- namespace == o.namespace
202
- end
203
-
204
- # @see the `==` method
205
- # @param [Object] Object to be compared
206
- def eql?(o)
207
- self == o
208
- end
209
-
210
- # Calculates hash code according to all attributes.
211
- # @return [Integer] Hash code
212
- def hash
213
- [pulp_href, artifact, pulp_created, version, name, namespace].hash
214
- end
215
-
216
- # Builds the object from hash
217
- # @param [Hash] attributes Model attributes in the form of hash
218
- # @return [Object] Returns the model itself
219
- def self.build_from_hash(attributes)
220
- new.build_from_hash(attributes)
221
- end
222
-
223
- # Builds the object from hash
224
- # @param [Hash] attributes Model attributes in the form of hash
225
- # @return [Object] Returns the model itself
226
- def build_from_hash(attributes)
227
- return nil unless attributes.is_a?(Hash)
228
- self.class.openapi_types.each_pair do |key, type|
229
- if type =~ /\AArray<(.*)>/i
230
- # check to ensure the input is an array given that the attribute
231
- # is documented as an array but the input is not
232
- if attributes[self.class.attribute_map[key]].is_a?(Array)
233
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
234
- end
235
- elsif !attributes[self.class.attribute_map[key]].nil?
236
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
237
- end # or else data not found in attributes(hash), not an issue as the data can be optional
238
- end
239
-
240
- self
241
- end
242
-
243
- # Deserializes the data based on type
244
- # @param string type Data type
245
- # @param string value Value to be deserialized
246
- # @return [Object] Deserialized data
247
- def _deserialize(type, value)
248
- case type.to_sym
249
- when :DateTime
250
- DateTime.parse(value)
251
- when :Date
252
- Date.parse(value)
253
- when :String
254
- value.to_s
255
- when :Integer
256
- value.to_i
257
- when :Float
258
- value.to_f
259
- when :Boolean
260
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
261
- true
262
- else
263
- false
264
- end
265
- when :Object
266
- # generic object (usually a Hash), return directly
267
- value
268
- when /\AArray<(?<inner_type>.+)>\z/
269
- inner_type = Regexp.last_match[:inner_type]
270
- value.map { |v| _deserialize(inner_type, v) }
271
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
272
- k_type = Regexp.last_match[:k_type]
273
- v_type = Regexp.last_match[:v_type]
274
- {}.tap do |hash|
275
- value.each do |k, v|
276
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
277
- end
278
- end
279
- else # model
280
- PulpAnsibleClient.const_get(type).build_from_hash(value)
281
- end
282
- end
283
-
284
- # Returns the string representation of the object
285
- # @return [String] String presentation of the object
286
- def to_s
287
- to_hash.to_s
288
- end
289
-
290
- # to_body is an alias to to_hash (backward compatibility)
291
- # @return [Hash] Returns the object in the form of hash
292
- def to_body
293
- to_hash
294
- end
295
-
296
- # Returns the object in the form of hash
297
- # @return [Hash] Returns the object in the form of hash
298
- def to_hash
299
- hash = {}
300
- self.class.attribute_map.each_pair do |attr, param|
301
- value = self.send(attr)
302
- if value.nil?
303
- is_nullable = self.class.openapi_nullable.include?(attr)
304
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
305
- end
306
-
307
- hash[param] = _to_hash(value)
308
- end
309
- hash
310
- end
311
-
312
- # Outputs non-array value in the form of hash
313
- # For object, use to_hash. Otherwise, just return the value
314
- # @param [Object] value Any valid value
315
- # @return [Hash] Returns the value in the form of hash
316
- def _to_hash(value)
317
- if value.is_a?(Array)
318
- value.compact.map { |v| _to_hash(v) }
319
- elsif value.is_a?(Hash)
320
- {}.tap do |hash|
321
- value.each { |k, v| hash[k] = _to_hash(v) }
322
- end
323
- elsif value.respond_to? :to_hash
324
- value.to_hash
325
- else
326
- value
327
- end
328
- end
329
- end
330
- end
@@ -1,314 +0,0 @@
1
- =begin
2
- #Pulp 3 API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: v3
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PulpAnsibleClient
16
- class CollectionRead
17
- attr_accessor :href
18
-
19
- attr_accessor :created_at
20
-
21
- attr_accessor :updated_at
22
-
23
- attr_accessor :namespace
24
-
25
- attr_accessor :name
26
-
27
- attr_accessor :deprecated
28
-
29
- attr_accessor :versions_url
30
-
31
- attr_accessor :highest_version
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'href' => :'href',
37
- :'created_at' => :'created_at',
38
- :'updated_at' => :'updated_at',
39
- :'namespace' => :'namespace',
40
- :'name' => :'name',
41
- :'deprecated' => :'deprecated',
42
- :'versions_url' => :'versions_url',
43
- :'highest_version' => :'highest_version'
44
- }
45
- end
46
-
47
- # Attribute type mapping.
48
- def self.openapi_types
49
- {
50
- :'href' => :'String',
51
- :'created_at' => :'DateTime',
52
- :'updated_at' => :'DateTime',
53
- :'namespace' => :'String',
54
- :'name' => :'String',
55
- :'deprecated' => :'Boolean',
56
- :'versions_url' => :'String',
57
- :'highest_version' => :'String'
58
- }
59
- end
60
-
61
- # List of attributes with nullable: true
62
- def self.openapi_nullable
63
- Set.new([
64
- ])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::CollectionRead` initialize method"
72
- end
73
-
74
- # check to see if the attribute exists and convert string to symbol for hash key
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::CollectionRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'href')
83
- self.href = attributes[:'href']
84
- end
85
-
86
- if attributes.key?(:'created_at')
87
- self.created_at = attributes[:'created_at']
88
- end
89
-
90
- if attributes.key?(:'updated_at')
91
- self.updated_at = attributes[:'updated_at']
92
- end
93
-
94
- if attributes.key?(:'namespace')
95
- self.namespace = attributes[:'namespace']
96
- end
97
-
98
- if attributes.key?(:'name')
99
- self.name = attributes[:'name']
100
- end
101
-
102
- if attributes.key?(:'deprecated')
103
- self.deprecated = attributes[:'deprecated']
104
- end
105
-
106
- if attributes.key?(:'versions_url')
107
- self.versions_url = attributes[:'versions_url']
108
- end
109
-
110
- if attributes.key?(:'highest_version')
111
- self.highest_version = attributes[:'highest_version']
112
- end
113
- end
114
-
115
- # Show invalid properties with the reasons. Usually used together with valid?
116
- # @return Array for valid properties with the reasons
117
- def list_invalid_properties
118
- invalid_properties = Array.new
119
- if @created_at.nil?
120
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
121
- end
122
-
123
- if @updated_at.nil?
124
- invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
125
- end
126
-
127
- if !@namespace.nil? && @namespace.to_s.length < 1
128
- invalid_properties.push('invalid value for "namespace", the character length must be great than or equal to 1.')
129
- end
130
-
131
- if !@name.nil? && @name.to_s.length < 1
132
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
133
- end
134
-
135
- if @deprecated.nil?
136
- invalid_properties.push('invalid value for "deprecated", deprecated cannot be nil.')
137
- end
138
-
139
- invalid_properties
140
- end
141
-
142
- # Check to see if the all the properties in the model are valid
143
- # @return true if the model is valid
144
- def valid?
145
- return false if @created_at.nil?
146
- return false if @updated_at.nil?
147
- return false if !@namespace.nil? && @namespace.to_s.length < 1
148
- return false if !@name.nil? && @name.to_s.length < 1
149
- return false if @deprecated.nil?
150
- true
151
- end
152
-
153
- # Custom attribute writer method with validation
154
- # @param [Object] namespace Value to be assigned
155
- def namespace=(namespace)
156
- if !namespace.nil? && namespace.to_s.length < 1
157
- fail ArgumentError, 'invalid value for "namespace", the character length must be great than or equal to 1.'
158
- end
159
-
160
- @namespace = namespace
161
- end
162
-
163
- # Custom attribute writer method with validation
164
- # @param [Object] name Value to be assigned
165
- def name=(name)
166
- if !name.nil? && name.to_s.length < 1
167
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
168
- end
169
-
170
- @name = name
171
- end
172
-
173
- # Checks equality by comparing each attribute.
174
- # @param [Object] Object to be compared
175
- def ==(o)
176
- return true if self.equal?(o)
177
- self.class == o.class &&
178
- href == o.href &&
179
- created_at == o.created_at &&
180
- updated_at == o.updated_at &&
181
- namespace == o.namespace &&
182
- name == o.name &&
183
- deprecated == o.deprecated &&
184
- versions_url == o.versions_url &&
185
- highest_version == o.highest_version
186
- end
187
-
188
- # @see the `==` method
189
- # @param [Object] Object to be compared
190
- def eql?(o)
191
- self == o
192
- end
193
-
194
- # Calculates hash code according to all attributes.
195
- # @return [Integer] Hash code
196
- def hash
197
- [href, created_at, updated_at, namespace, name, deprecated, versions_url, highest_version].hash
198
- end
199
-
200
- # Builds the object from hash
201
- # @param [Hash] attributes Model attributes in the form of hash
202
- # @return [Object] Returns the model itself
203
- def self.build_from_hash(attributes)
204
- new.build_from_hash(attributes)
205
- end
206
-
207
- # Builds the object from hash
208
- # @param [Hash] attributes Model attributes in the form of hash
209
- # @return [Object] Returns the model itself
210
- def build_from_hash(attributes)
211
- return nil unless attributes.is_a?(Hash)
212
- self.class.openapi_types.each_pair do |key, type|
213
- if type =~ /\AArray<(.*)>/i
214
- # check to ensure the input is an array given that the attribute
215
- # is documented as an array but the input is not
216
- if attributes[self.class.attribute_map[key]].is_a?(Array)
217
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
218
- end
219
- elsif !attributes[self.class.attribute_map[key]].nil?
220
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
221
- end # or else data not found in attributes(hash), not an issue as the data can be optional
222
- end
223
-
224
- self
225
- end
226
-
227
- # Deserializes the data based on type
228
- # @param string type Data type
229
- # @param string value Value to be deserialized
230
- # @return [Object] Deserialized data
231
- def _deserialize(type, value)
232
- case type.to_sym
233
- when :DateTime
234
- DateTime.parse(value)
235
- when :Date
236
- Date.parse(value)
237
- when :String
238
- value.to_s
239
- when :Integer
240
- value.to_i
241
- when :Float
242
- value.to_f
243
- when :Boolean
244
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
245
- true
246
- else
247
- false
248
- end
249
- when :Object
250
- # generic object (usually a Hash), return directly
251
- value
252
- when /\AArray<(?<inner_type>.+)>\z/
253
- inner_type = Regexp.last_match[:inner_type]
254
- value.map { |v| _deserialize(inner_type, v) }
255
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
256
- k_type = Regexp.last_match[:k_type]
257
- v_type = Regexp.last_match[:v_type]
258
- {}.tap do |hash|
259
- value.each do |k, v|
260
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
261
- end
262
- end
263
- else # model
264
- PulpAnsibleClient.const_get(type).build_from_hash(value)
265
- end
266
- end
267
-
268
- # Returns the string representation of the object
269
- # @return [String] String presentation of the object
270
- def to_s
271
- to_hash.to_s
272
- end
273
-
274
- # to_body is an alias to to_hash (backward compatibility)
275
- # @return [Hash] Returns the object in the form of hash
276
- def to_body
277
- to_hash
278
- end
279
-
280
- # Returns the object in the form of hash
281
- # @return [Hash] Returns the object in the form of hash
282
- def to_hash
283
- hash = {}
284
- self.class.attribute_map.each_pair do |attr, param|
285
- value = self.send(attr)
286
- if value.nil?
287
- is_nullable = self.class.openapi_nullable.include?(attr)
288
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
289
- end
290
-
291
- hash[param] = _to_hash(value)
292
- end
293
- hash
294
- end
295
-
296
- # Outputs non-array value in the form of hash
297
- # For object, use to_hash. Otherwise, just return the value
298
- # @param [Object] value Any valid value
299
- # @return [Hash] Returns the value in the form of hash
300
- def _to_hash(value)
301
- if value.is_a?(Array)
302
- value.compact.map { |v| _to_hash(v) }
303
- elsif value.is_a?(Hash)
304
- {}.tap do |hash|
305
- value.each { |k, v| hash[k] = _to_hash(v) }
306
- end
307
- elsif value.respond_to? :to_hash
308
- value.to_hash
309
- else
310
- value
311
- end
312
- end
313
- end
314
- end