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