pulp_ansible_client 0.2.0b12 → 0.2.0b13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -11
- data/docs/AnsibleAnsibleDistributionRead.md +31 -0
- data/docs/AnsibleAnsibleRemote.md +7 -3
- data/docs/AnsibleAnsibleRemoteRead.md +43 -0
- data/docs/AnsibleAnsibleRepositoryRead.md +27 -0
- data/docs/{AnsibleCollection.md → AnsibleCollectionRead.md} +2 -2
- data/docs/AnsibleCollectionRemote.md +7 -3
- data/docs/AnsibleCollectionRemoteRead.md +45 -0
- data/docs/AnsibleCollectionVersion.md +4 -4
- data/docs/AnsibleCollectionVersionRead.md +67 -0
- data/docs/AnsibleCollectionsApi.md +1 -1
- data/docs/AnsibleRole.md +4 -4
- data/docs/AnsibleRoleRead.md +27 -0
- data/docs/{CollectionImportDetail.md → CollectionImportDetailRead.md} +2 -2
- data/docs/CollectionRead.md +31 -0
- data/docs/CollectionVersionRead.md +37 -0
- data/docs/ContentCollectionVersionsApi.md +5 -5
- data/docs/ContentRolesApi.md +5 -5
- data/docs/DistributionsAnsibleApi.md +3 -3
- data/docs/GalaxyCollectionRead.md +23 -0
- data/docs/{GalaxyCollectionVersion.md → GalaxyCollectionVersionRead.md} +2 -2
- data/docs/{GalaxyRole.md → GalaxyRoleRead.md} +2 -2
- data/docs/{GalaxyRoleVersion.md → GalaxyRoleVersionRead.md} +2 -2
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse20010.md +1 -1
- data/docs/InlineResponse20011.md +1 -1
- data/docs/InlineResponse20012.md +1 -1
- data/docs/InlineResponse20013.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +1 -1
- data/docs/InlineResponse2007.md +1 -1
- data/docs/InlineResponse2008.md +1 -1
- data/docs/InlineResponse2009.md +1 -1
- data/docs/PulpAnsibleApiApi.md +1 -1
- data/docs/PulpAnsibleGalaxyApiCollectionsApi.md +5 -5
- data/docs/PulpAnsibleGalaxyApiRolesApi.md +1 -1
- data/docs/PulpAnsibleGalaxyApiV1VersionsApi.md +1 -1
- data/docs/PulpAnsibleGalaxyApiV2VersionsApi.md +1 -1
- data/docs/PulpAnsibleGalaxyApiV3CollectionsApi.md +3 -3
- data/docs/PulpAnsibleTagsApi.md +1 -1
- data/docs/RemotesAnsibleApi.md +5 -5
- data/docs/RemotesCollectionApi.md +5 -5
- data/docs/RepositoriesAnsibleApi.md +10 -10
- data/docs/RepositoriesAnsibleVersionsApi.md +3 -3
- data/docs/RepositoryVersionRead.md +25 -0
- data/docs/{Tag.md → TagRead.md} +2 -2
- data/lib/pulp_ansible_client/api/content_collection_versions_api.rb +6 -6
- data/lib/pulp_ansible_client/api/content_roles_api.rb +6 -6
- data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +3 -3
- data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb +6 -6
- data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v3_collections_api.rb +3 -3
- data/lib/pulp_ansible_client/api/remotes_ansible_api.rb +6 -6
- data/lib/pulp_ansible_client/api/remotes_collection_api.rb +6 -6
- data/lib/pulp_ansible_client/api/repositories_ansible_api.rb +15 -15
- data/lib/pulp_ansible_client/api/repositories_ansible_versions_api.rb +3 -3
- data/lib/pulp_ansible_client/configuration.rb +2 -2
- data/lib/pulp_ansible_client/models/ansible_ansible_distribution_read.rb +327 -0
- data/lib/pulp_ansible_client/models/ansible_ansible_remote.rb +56 -4
- data/lib/pulp_ansible_client/models/ansible_ansible_remote_read.rb +531 -0
- data/lib/pulp_ansible_client/models/ansible_ansible_repository_read.rb +294 -0
- data/lib/pulp_ansible_client/models/{ansible_collection.rb → ansible_collection_read.rb} +3 -3
- data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +56 -4
- data/lib/pulp_ansible_client/models/ansible_collection_remote_read.rb +557 -0
- data/lib/pulp_ansible_client/models/ansible_collection_version.rb +35 -35
- data/lib/pulp_ansible_client/models/ansible_collection_version_read.rb +816 -0
- data/lib/pulp_ansible_client/models/ansible_role.rb +15 -15
- data/lib/pulp_ansible_client/models/ansible_role_read.rb +330 -0
- data/lib/pulp_ansible_client/models/{collection_import_detail.rb → collection_import_detail_read.rb} +3 -3
- data/lib/pulp_ansible_client/models/collection_read.rb +314 -0
- data/lib/pulp_ansible_client/models/collection_version_read.rb +370 -0
- data/lib/pulp_ansible_client/models/galaxy_collection_read.rb +281 -0
- data/lib/pulp_ansible_client/models/{galaxy_collection_version.rb → galaxy_collection_version_read.rb} +3 -3
- data/lib/pulp_ansible_client/models/{galaxy_role.rb → galaxy_role_read.rb} +3 -3
- data/lib/pulp_ansible_client/models/{galaxy_role_version.rb → galaxy_role_version_read.rb} +3 -3
- data/lib/pulp_ansible_client/models/inline_response200.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2001.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response20010.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response20011.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response20012.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response20013.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2002.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2003.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2004.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2005.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2006.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2007.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2008.rb +1 -1
- data/lib/pulp_ansible_client/models/inline_response2009.rb +1 -1
- data/lib/pulp_ansible_client/models/repository_version_read.rb +244 -0
- data/lib/pulp_ansible_client/models/{tag.rb → tag_read.rb} +3 -3
- data/lib/pulp_ansible_client/version.rb +1 -1
- data/lib/pulp_ansible_client.rb +16 -6
- data/spec/api/content_collection_versions_api_spec.rb +2 -2
- data/spec/api/content_roles_api_spec.rb +2 -2
- data/spec/api/distributions_ansible_api_spec.rb +1 -1
- data/spec/api/pulp_ansible_galaxy_api_collections_api_spec.rb +2 -2
- data/spec/api/pulp_ansible_galaxy_api_v3_collections_api_spec.rb +1 -1
- data/spec/api/remotes_ansible_api_spec.rb +2 -2
- data/spec/api/remotes_collection_api_spec.rb +2 -2
- data/spec/api/repositories_ansible_api_spec.rb +6 -6
- data/spec/api/repositories_ansible_versions_api_spec.rb +1 -1
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/ansible_ansible_distribution_read_spec.rb +83 -0
- data/spec/models/ansible_ansible_remote_read_spec.rb +123 -0
- data/spec/models/ansible_ansible_remote_spec.rb +12 -0
- data/spec/models/ansible_ansible_repository_read_spec.rb +71 -0
- data/spec/models/{ansible_collection_spec.rb → ansible_collection_read_spec.rb} +6 -6
- data/spec/models/ansible_collection_remote_read_spec.rb +129 -0
- data/spec/models/ansible_collection_remote_spec.rb +12 -0
- data/spec/models/ansible_collection_version_read_spec.rb +191 -0
- data/spec/models/ansible_collection_version_spec.rb +2 -2
- data/spec/models/ansible_role_read_spec.rb +71 -0
- data/spec/models/ansible_role_spec.rb +2 -2
- data/spec/models/{collection_import_detail_spec.rb → collection_import_detail_read_spec.rb} +6 -6
- data/spec/models/collection_read_spec.rb +83 -0
- data/spec/models/collection_version_read_spec.rb +105 -0
- data/spec/models/galaxy_collection_read_spec.rb +59 -0
- data/spec/models/{galaxy_collection_version_spec.rb → galaxy_collection_version_read_spec.rb} +6 -6
- data/spec/models/{galaxy_role_spec.rb → galaxy_role_read_spec.rb} +6 -6
- data/spec/models/{galaxy_role_version_spec.rb → galaxy_role_version_read_spec.rb} +6 -6
- data/spec/models/repository_version_read_spec.rb +65 -0
- data/spec/models/{tag_spec.rb → tag_read_spec.rb} +6 -6
- metadata +66 -26
@@ -14,13 +14,13 @@ require 'date'
|
|
14
14
|
|
15
15
|
module PulpAnsibleClient
|
16
16
|
class AnsibleRole
|
17
|
-
#
|
18
|
-
attr_accessor :
|
17
|
+
# Timestamp of creation.
|
18
|
+
attr_accessor :pulp_created
|
19
19
|
|
20
20
|
attr_accessor :pulp_href
|
21
21
|
|
22
|
-
#
|
23
|
-
attr_accessor :
|
22
|
+
# Artifact file representing the physical content
|
23
|
+
attr_accessor :artifact
|
24
24
|
|
25
25
|
attr_accessor :version
|
26
26
|
|
@@ -31,9 +31,9 @@ module PulpAnsibleClient
|
|
31
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
32
|
def self.attribute_map
|
33
33
|
{
|
34
|
-
:'artifact' => :'artifact',
|
35
|
-
:'pulp_href' => :'pulp_href',
|
36
34
|
:'pulp_created' => :'pulp_created',
|
35
|
+
:'pulp_href' => :'pulp_href',
|
36
|
+
:'artifact' => :'artifact',
|
37
37
|
:'version' => :'version',
|
38
38
|
:'name' => :'name',
|
39
39
|
:'namespace' => :'namespace'
|
@@ -43,9 +43,9 @@ module PulpAnsibleClient
|
|
43
43
|
# Attribute type mapping.
|
44
44
|
def self.openapi_types
|
45
45
|
{
|
46
|
-
:'artifact' => :'String',
|
47
|
-
:'pulp_href' => :'String',
|
48
46
|
:'pulp_created' => :'DateTime',
|
47
|
+
:'pulp_href' => :'String',
|
48
|
+
:'artifact' => :'String',
|
49
49
|
:'version' => :'String',
|
50
50
|
:'name' => :'String',
|
51
51
|
:'namespace' => :'String'
|
@@ -73,16 +73,16 @@ module PulpAnsibleClient
|
|
73
73
|
h[k.to_sym] = v
|
74
74
|
}
|
75
75
|
|
76
|
-
if attributes.key?(:'
|
77
|
-
self.
|
76
|
+
if attributes.key?(:'pulp_created')
|
77
|
+
self.pulp_created = attributes[:'pulp_created']
|
78
78
|
end
|
79
79
|
|
80
80
|
if attributes.key?(:'pulp_href')
|
81
81
|
self.pulp_href = attributes[:'pulp_href']
|
82
82
|
end
|
83
83
|
|
84
|
-
if attributes.key?(:'
|
85
|
-
self.
|
84
|
+
if attributes.key?(:'artifact')
|
85
|
+
self.artifact = attributes[:'artifact']
|
86
86
|
end
|
87
87
|
|
88
88
|
if attributes.key?(:'version')
|
@@ -193,9 +193,9 @@ module PulpAnsibleClient
|
|
193
193
|
def ==(o)
|
194
194
|
return true if self.equal?(o)
|
195
195
|
self.class == o.class &&
|
196
|
-
artifact == o.artifact &&
|
197
|
-
pulp_href == o.pulp_href &&
|
198
196
|
pulp_created == o.pulp_created &&
|
197
|
+
pulp_href == o.pulp_href &&
|
198
|
+
artifact == o.artifact &&
|
199
199
|
version == o.version &&
|
200
200
|
name == o.name &&
|
201
201
|
namespace == o.namespace
|
@@ -210,7 +210,7 @@ module PulpAnsibleClient
|
|
210
210
|
# Calculates hash code according to all attributes.
|
211
211
|
# @return [Integer] Hash code
|
212
212
|
def hash
|
213
|
-
[
|
213
|
+
[pulp_created, pulp_href, artifact, version, name, namespace].hash
|
214
214
|
end
|
215
215
|
|
216
216
|
# Builds the object from hash
|
@@ -0,0 +1,330 @@
|
|
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
|
+
# Timestamp of creation.
|
18
|
+
attr_accessor :pulp_created
|
19
|
+
|
20
|
+
attr_accessor :pulp_href
|
21
|
+
|
22
|
+
# Artifact file representing the physical content
|
23
|
+
attr_accessor :artifact
|
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_created' => :'pulp_created',
|
35
|
+
:'pulp_href' => :'pulp_href',
|
36
|
+
:'artifact' => :'artifact',
|
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_created' => :'DateTime',
|
47
|
+
:'pulp_href' => :'String',
|
48
|
+
:'artifact' => :'String',
|
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_created')
|
77
|
+
self.pulp_created = attributes[:'pulp_created']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'pulp_href')
|
81
|
+
self.pulp_href = attributes[:'pulp_href']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'artifact')
|
85
|
+
self.artifact = attributes[:'artifact']
|
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_created == o.pulp_created &&
|
197
|
+
pulp_href == o.pulp_href &&
|
198
|
+
artifact == o.artifact &&
|
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_created, pulp_href, artifact, 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
|
data/lib/pulp_ansible_client/models/{collection_import_detail.rb → collection_import_detail_read.rb}
RENAMED
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpAnsibleClient
|
16
|
-
class
|
16
|
+
class CollectionImportDetailRead
|
17
17
|
attr_accessor :id
|
18
18
|
|
19
19
|
attr_accessor :state
|
@@ -68,13 +68,13 @@ module PulpAnsibleClient
|
|
68
68
|
# @param [Hash] attributes Model attributes in the form of hash
|
69
69
|
def initialize(attributes = {})
|
70
70
|
if (!attributes.is_a?(Hash))
|
71
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::CollectionImportDetailRead` initialize method"
|
72
72
|
end
|
73
73
|
|
74
74
|
# check to see if the attribute exists and convert string to symbol for hash key
|
75
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
76
|
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::CollectionImportDetailRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
78
|
end
|
79
79
|
h[k.to_sym] = v
|
80
80
|
}
|