pulpcore_client 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -4
  3. data/docs/InlineResponse2001.md +1 -1
  4. data/docs/InlineResponse2002.md +1 -1
  5. data/docs/InlineResponse2003.md +1 -1
  6. data/docs/InlineResponse2004.md +23 -0
  7. data/docs/SigningService.md +23 -0
  8. data/docs/SigningServicesApi.md +130 -0
  9. data/docs/TasksApi.md +2 -2
  10. data/docs/UploadsApi.md +2 -2
  11. data/docs/WorkersApi.md +2 -2
  12. data/lib/pulpcore_client/api/artifacts_api.rb +1 -1
  13. data/lib/pulpcore_client/api/orphans_api.rb +1 -1
  14. data/lib/pulpcore_client/api/signing_services_api.rb +158 -0
  15. data/lib/pulpcore_client/api/status_api.rb +1 -1
  16. data/lib/pulpcore_client/api/tasks_api.rb +4 -4
  17. data/lib/pulpcore_client/api/uploads_api.rb +4 -4
  18. data/lib/pulpcore_client/api/workers_api.rb +4 -4
  19. data/lib/pulpcore_client/api_client.rb +1 -1
  20. data/lib/pulpcore_client/api_error.rb +1 -1
  21. data/lib/pulpcore_client/configuration.rb +1 -1
  22. data/lib/pulpcore_client/models/artifact.rb +1 -1
  23. data/lib/pulpcore_client/models/async_operation_response.rb +1 -1
  24. data/lib/pulpcore_client/models/content_app_status.rb +1 -1
  25. data/lib/pulpcore_client/models/database_connection.rb +1 -1
  26. data/lib/pulpcore_client/models/inline_response200.rb +1 -1
  27. data/lib/pulpcore_client/models/inline_response2001.rb +2 -2
  28. data/lib/pulpcore_client/models/inline_response2002.rb +2 -2
  29. data/lib/pulpcore_client/models/inline_response2003.rb +2 -2
  30. data/lib/pulpcore_client/models/inline_response2004.rb +247 -0
  31. data/lib/pulpcore_client/models/progress_report.rb +1 -1
  32. data/lib/pulpcore_client/models/redis_connection.rb +1 -1
  33. data/lib/pulpcore_client/models/signing_service.rb +284 -0
  34. data/lib/pulpcore_client/models/status.rb +1 -1
  35. data/lib/pulpcore_client/models/storage.rb +1 -1
  36. data/lib/pulpcore_client/models/task.rb +1 -1
  37. data/lib/pulpcore_client/models/task_cancel.rb +1 -1
  38. data/lib/pulpcore_client/models/upload.rb +1 -1
  39. data/lib/pulpcore_client/models/upload_chunk.rb +1 -1
  40. data/lib/pulpcore_client/models/upload_commit.rb +1 -1
  41. data/lib/pulpcore_client/models/upload_detail.rb +1 -1
  42. data/lib/pulpcore_client/models/version.rb +1 -1
  43. data/lib/pulpcore_client/models/worker.rb +1 -1
  44. data/lib/pulpcore_client/version.rb +2 -2
  45. data/lib/pulpcore_client.rb +4 -1
  46. data/pulpcore_client.gemspec +1 -1
  47. data/spec/api/artifacts_api_spec.rb +1 -1
  48. data/spec/api/orphans_api_spec.rb +1 -1
  49. data/spec/api/signing_services_api_spec.rb +64 -0
  50. data/spec/api/status_api_spec.rb +1 -1
  51. data/spec/api/tasks_api_spec.rb +2 -2
  52. data/spec/api/uploads_api_spec.rb +2 -2
  53. data/spec/api/workers_api_spec.rb +2 -2
  54. data/spec/api_client_spec.rb +1 -1
  55. data/spec/configuration_spec.rb +1 -1
  56. data/spec/models/artifact_spec.rb +1 -1
  57. data/spec/models/async_operation_response_spec.rb +1 -1
  58. data/spec/models/content_app_status_spec.rb +1 -1
  59. data/spec/models/database_connection_spec.rb +1 -1
  60. data/spec/models/inline_response2001_spec.rb +1 -1
  61. data/spec/models/inline_response2002_spec.rb +1 -1
  62. data/spec/models/inline_response2003_spec.rb +1 -1
  63. data/spec/models/inline_response2004_spec.rb +59 -0
  64. data/spec/models/inline_response200_spec.rb +1 -1
  65. data/spec/models/progress_report_spec.rb +1 -1
  66. data/spec/models/redis_connection_spec.rb +1 -1
  67. data/spec/models/signing_service_spec.rb +59 -0
  68. data/spec/models/status_spec.rb +1 -1
  69. data/spec/models/storage_spec.rb +1 -1
  70. data/spec/models/task_cancel_spec.rb +1 -1
  71. data/spec/models/task_spec.rb +1 -1
  72. data/spec/models/upload_chunk_spec.rb +1 -1
  73. data/spec/models/upload_commit_spec.rb +1 -1
  74. data/spec/models/upload_detail_spec.rb +1 -1
  75. data/spec/models/upload_spec.rb +1 -1
  76. data/spec/models/version_spec.rb +1 -1
  77. data/spec/models/worker_spec.rb +1 -1
  78. data/spec/spec_helper.rb +1 -1
  79. metadata +43 -32
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -38,7 +38,7 @@ module PulpcoreClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<Task>'
41
+ :'results' => :'Array<SigningService>'
42
42
  }
43
43
  end
44
44
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -38,7 +38,7 @@ module PulpcoreClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<Upload>'
41
+ :'results' => :'Array<Task>'
42
42
  }
43
43
  end
44
44
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -38,7 +38,7 @@ module PulpcoreClient
38
38
  :'count' => :'Integer',
39
39
  :'_next' => :'String',
40
40
  :'previous' => :'String',
41
- :'results' => :'Array<Worker>'
41
+ :'results' => :'Array<Upload>'
42
42
  }
43
43
  end
44
44
 
@@ -0,0 +1,247 @@
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.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ class InlineResponse2004
17
+ attr_accessor :count
18
+
19
+ attr_accessor :_next
20
+
21
+ attr_accessor :previous
22
+
23
+ attr_accessor :results
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'count' => :'count',
29
+ :'_next' => :'next',
30
+ :'previous' => :'previous',
31
+ :'results' => :'results'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'count' => :'Integer',
39
+ :'_next' => :'String',
40
+ :'previous' => :'String',
41
+ :'results' => :'Array<Worker>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'_next',
49
+ :'previous',
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::InlineResponse2004` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::InlineResponse2004`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'count')
69
+ self.count = attributes[:'count']
70
+ end
71
+
72
+ if attributes.key?(:'_next')
73
+ self._next = attributes[:'_next']
74
+ end
75
+
76
+ if attributes.key?(:'previous')
77
+ self.previous = attributes[:'previous']
78
+ end
79
+
80
+ if attributes.key?(:'results')
81
+ if (value = attributes[:'results']).is_a?(Array)
82
+ self.results = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ if @count.nil?
92
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
93
+ end
94
+
95
+ if @results.nil?
96
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @count.nil?
106
+ return false if @results.nil?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ count == o.count &&
116
+ _next == o._next &&
117
+ previous == o.previous &&
118
+ results == o.results
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [count, _next, previous, results].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.openapi_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ PulpcoreClient.const_get(type).build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+ end
247
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,284 @@
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.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ class SigningService
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # A unique name used to recognize a script.
23
+ attr_accessor :name
24
+
25
+ # An absolute path to a script which is going to be used for the signing.
26
+ attr_accessor :script
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'pulp_href' => :'pulp_href',
32
+ :'pulp_created' => :'pulp_created',
33
+ :'name' => :'name',
34
+ :'script' => :'script'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'pulp_href' => :'String',
42
+ :'pulp_created' => :'DateTime',
43
+ :'name' => :'String',
44
+ :'script' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::SigningService` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::SigningService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'pulp_href')
70
+ self.pulp_href = attributes[:'pulp_href']
71
+ end
72
+
73
+ if attributes.key?(:'pulp_created')
74
+ self.pulp_created = attributes[:'pulp_created']
75
+ end
76
+
77
+ if attributes.key?(:'name')
78
+ self.name = attributes[:'name']
79
+ end
80
+
81
+ if attributes.key?(:'script')
82
+ self.script = attributes[:'script']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @name.nil?
91
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
92
+ end
93
+
94
+ if @name.to_s.length < 1
95
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
96
+ end
97
+
98
+ if @script.nil?
99
+ invalid_properties.push('invalid value for "script", script cannot be nil.')
100
+ end
101
+
102
+ if @script.to_s.length < 1
103
+ invalid_properties.push('invalid value for "script", the character length must be great than or equal to 1.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @name.nil?
113
+ return false if @name.to_s.length < 1
114
+ return false if @script.nil?
115
+ return false if @script.to_s.length < 1
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] name Value to be assigned
121
+ def name=(name)
122
+ if name.nil?
123
+ fail ArgumentError, 'name cannot be nil'
124
+ end
125
+
126
+ if name.to_s.length < 1
127
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
128
+ end
129
+
130
+ @name = name
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] script Value to be assigned
135
+ def script=(script)
136
+ if script.nil?
137
+ fail ArgumentError, 'script cannot be nil'
138
+ end
139
+
140
+ if script.to_s.length < 1
141
+ fail ArgumentError, 'invalid value for "script", the character length must be great than or equal to 1.'
142
+ end
143
+
144
+ @script = script
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ pulp_href == o.pulp_href &&
153
+ pulp_created == o.pulp_created &&
154
+ name == o.name &&
155
+ script == o.script
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [pulp_href, pulp_created, name, script].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ new.build_from_hash(attributes)
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.openapi_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ PulpcoreClient.const_get(type).build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+ end
284
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12