pulp_container_client 2.17.0 → 2.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -6
  3. data/docs/ContainerContainerDistribution.md +6 -6
  4. data/docs/ContainerContainerDistributionResponse.md +12 -10
  5. data/docs/ContainerContainerPullThroughDistribution.md +35 -0
  6. data/docs/ContainerContainerPullThroughDistributionResponse.md +41 -0
  7. data/docs/ContainerContainerPullThroughRemote.md +57 -0
  8. data/docs/ContainerContainerPullThroughRemoteResponse.md +55 -0
  9. data/docs/{ContainerContainerRemoteResponseHiddenFields.md → ContainerContainerPullThroughRemoteResponseHiddenFields.md} +2 -2
  10. data/docs/ContainerContainerPushRepository.md +3 -3
  11. data/docs/ContainerContainerPushRepositoryResponse.md +12 -12
  12. data/docs/ContainerContainerRemote.md +1 -1
  13. data/docs/ContainerContainerRemoteResponse.md +2 -2
  14. data/docs/ContentBlobsApi.md +2 -0
  15. data/docs/ContentManifestsApi.md +2 -0
  16. data/docs/ContentSignaturesApi.md +2 -0
  17. data/docs/ContentTagsApi.md +2 -0
  18. data/docs/DistributionsPullThroughApi.md +736 -0
  19. data/docs/PaginatedcontainerContainerPullThroughDistributionResponseList.md +23 -0
  20. data/docs/PaginatedcontainerContainerPullThroughRemoteResponseList.md +23 -0
  21. data/docs/PatchedcontainerContainerDistribution.md +6 -6
  22. data/docs/PatchedcontainerContainerPullThroughDistribution.md +35 -0
  23. data/docs/PatchedcontainerContainerPullThroughRemote.md +57 -0
  24. data/docs/PatchedcontainerContainerPushRepository.md +3 -3
  25. data/docs/PatchedcontainerContainerRemote.md +1 -1
  26. data/docs/{PolicyEnum.md → Policy762Enum.md} +2 -2
  27. data/docs/Policy8e2Enum.md +16 -0
  28. data/docs/RemotesPullThroughApi.md +734 -0
  29. data/lib/pulp_container_client/api/content_blobs_api.rb +3 -0
  30. data/lib/pulp_container_client/api/content_manifests_api.rb +3 -0
  31. data/lib/pulp_container_client/api/content_signatures_api.rb +3 -0
  32. data/lib/pulp_container_client/api/content_tags_api.rb +3 -0
  33. data/lib/pulp_container_client/api/distributions_pull_through_api.rb +907 -0
  34. data/lib/pulp_container_client/api/remotes_pull_through_api.rb +904 -0
  35. data/lib/pulp_container_client/models/container_container_distribution.rb +52 -52
  36. data/lib/pulp_container_client/models/container_container_distribution_response.rb +60 -50
  37. data/lib/pulp_container_client/models/container_container_pull_through_distribution.rb +373 -0
  38. data/lib/pulp_container_client/models/container_container_pull_through_distribution_response.rb +349 -0
  39. data/lib/pulp_container_client/models/container_container_pull_through_remote.rb +668 -0
  40. data/lib/pulp_container_client/models/container_container_pull_through_remote_response.rb +496 -0
  41. data/lib/pulp_container_client/models/{container_container_remote_response_hidden_fields.rb → container_container_pull_through_remote_response_hidden_fields.rb} +3 -3
  42. data/lib/pulp_container_client/models/container_container_push_repository.rb +30 -30
  43. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +47 -47
  44. data/lib/pulp_container_client/models/container_container_remote.rb +1 -1
  45. data/lib/pulp_container_client/models/container_container_remote_response.rb +2 -2
  46. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_distribution_response_list.rb +237 -0
  47. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_remote_response_list.rb +237 -0
  48. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +43 -43
  49. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_distribution.rb +350 -0
  50. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_remote.rb +650 -0
  51. data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +30 -30
  52. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +1 -1
  53. data/lib/pulp_container_client/models/{policy_enum.rb → policy762_enum.rb} +3 -3
  54. data/lib/pulp_container_client/models/policy8e2_enum.rb +35 -0
  55. data/lib/pulp_container_client/version.rb +1 -1
  56. data/lib/pulp_container_client.rb +13 -2
  57. data/spec/api/content_blobs_api_spec.rb +1 -0
  58. data/spec/api/content_manifests_api_spec.rb +1 -0
  59. data/spec/api/content_signatures_api_spec.rb +1 -0
  60. data/spec/api/content_tags_api_spec.rb +1 -0
  61. data/spec/api/distributions_pull_through_api_spec.rb +215 -0
  62. data/spec/api/remotes_pull_through_api_spec.rb +214 -0
  63. data/spec/models/container_container_distribution_response_spec.rb +14 -8
  64. data/spec/models/container_container_distribution_spec.rb +5 -5
  65. data/spec/models/container_container_pull_through_distribution_response_spec.rb +113 -0
  66. data/spec/models/container_container_pull_through_distribution_spec.rb +95 -0
  67. data/spec/models/{container_container_remote_response_hidden_fields_spec.rb → container_container_pull_through_remote_response_hidden_fields_spec.rb} +6 -6
  68. data/spec/models/container_container_pull_through_remote_response_spec.rb +155 -0
  69. data/spec/models/container_container_pull_through_remote_spec.rb +161 -0
  70. data/spec/models/container_container_push_repository_response_spec.rb +8 -8
  71. data/spec/models/container_container_push_repository_spec.rb +3 -3
  72. data/spec/models/paginatedcontainer_container_pull_through_distribution_response_list_spec.rb +59 -0
  73. data/spec/models/paginatedcontainer_container_pull_through_remote_response_list_spec.rb +59 -0
  74. data/spec/models/patchedcontainer_container_distribution_spec.rb +5 -5
  75. data/spec/models/patchedcontainer_container_pull_through_distribution_spec.rb +95 -0
  76. data/spec/models/patchedcontainer_container_pull_through_remote_spec.rb +161 -0
  77. data/spec/models/patchedcontainer_container_push_repository_spec.rb +3 -3
  78. data/spec/models/{policy_enum_spec.rb → policy762_enum_spec.rb} +6 -6
  79. data/spec/models/policy8e2_enum_spec.rb +35 -0
  80. metadata +102 -58
@@ -15,23 +15,23 @@ require 'date'
15
15
  module PulpContainerClient
16
16
  # A serializer for ContainerDistribution.
17
17
  class PatchedcontainerContainerDistribution
18
- # The latest RepositoryVersion for this Repository will be served.
19
- attr_accessor :repository
18
+ # An optional content-guard. If none is specified, a default one will be used.
19
+ attr_accessor :content_guard
20
20
 
21
21
  attr_accessor :pulp_labels
22
22
 
23
+ # A unique name. Ex, `rawhide` and `stable`.
24
+ attr_accessor :name
25
+
26
+ # The latest RepositoryVersion for this Repository will be served.
27
+ attr_accessor :repository
28
+
23
29
  # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
24
30
  attr_accessor :base_path
25
31
 
26
32
  # Whether this distribution should be shown in the content app.
27
33
  attr_accessor :hidden
28
34
 
29
- # An optional content-guard. If none is specified, a default one will be used.
30
- attr_accessor :content_guard
31
-
32
- # A unique name. Ex, `rawhide` and `stable`.
33
- attr_accessor :name
34
-
35
35
  # RepositoryVersion to be served
36
36
  attr_accessor :repository_version
37
37
 
@@ -44,12 +44,12 @@ module PulpContainerClient
44
44
  # Attribute mapping from ruby-style variable name to JSON key.
45
45
  def self.attribute_map
46
46
  {
47
- :'repository' => :'repository',
47
+ :'content_guard' => :'content_guard',
48
48
  :'pulp_labels' => :'pulp_labels',
49
+ :'name' => :'name',
50
+ :'repository' => :'repository',
49
51
  :'base_path' => :'base_path',
50
52
  :'hidden' => :'hidden',
51
- :'content_guard' => :'content_guard',
52
- :'name' => :'name',
53
53
  :'repository_version' => :'repository_version',
54
54
  :'private' => :'private',
55
55
  :'description' => :'description'
@@ -59,12 +59,12 @@ module PulpContainerClient
59
59
  # Attribute type mapping.
60
60
  def self.openapi_types
61
61
  {
62
- :'repository' => :'String',
62
+ :'content_guard' => :'String',
63
63
  :'pulp_labels' => :'Hash<String, String>',
64
+ :'name' => :'String',
65
+ :'repository' => :'String',
64
66
  :'base_path' => :'String',
65
67
  :'hidden' => :'Boolean',
66
- :'content_guard' => :'String',
67
- :'name' => :'String',
68
68
  :'repository_version' => :'String',
69
69
  :'private' => :'Boolean',
70
70
  :'description' => :'String'
@@ -95,8 +95,8 @@ module PulpContainerClient
95
95
  h[k.to_sym] = v
96
96
  }
97
97
 
98
- if attributes.key?(:'repository')
99
- self.repository = attributes[:'repository']
98
+ if attributes.key?(:'content_guard')
99
+ self.content_guard = attributes[:'content_guard']
100
100
  end
101
101
 
102
102
  if attributes.key?(:'pulp_labels')
@@ -105,6 +105,14 @@ module PulpContainerClient
105
105
  end
106
106
  end
107
107
 
108
+ if attributes.key?(:'name')
109
+ self.name = attributes[:'name']
110
+ end
111
+
112
+ if attributes.key?(:'repository')
113
+ self.repository = attributes[:'repository']
114
+ end
115
+
108
116
  if attributes.key?(:'base_path')
109
117
  self.base_path = attributes[:'base_path']
110
118
  end
@@ -115,14 +123,6 @@ module PulpContainerClient
115
123
  self.hidden = false
116
124
  end
117
125
 
118
- if attributes.key?(:'content_guard')
119
- self.content_guard = attributes[:'content_guard']
120
- end
121
-
122
- if attributes.key?(:'name')
123
- self.name = attributes[:'name']
124
- end
125
-
126
126
  if attributes.key?(:'repository_version')
127
127
  self.repository_version = attributes[:'repository_version']
128
128
  end
@@ -140,14 +140,14 @@ module PulpContainerClient
140
140
  # @return Array for valid properties with the reasons
141
141
  def list_invalid_properties
142
142
  invalid_properties = Array.new
143
- if !@base_path.nil? && @base_path.to_s.length < 1
144
- invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
145
- end
146
-
147
143
  if !@name.nil? && @name.to_s.length < 1
148
144
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
149
145
  end
150
146
 
147
+ if !@base_path.nil? && @base_path.to_s.length < 1
148
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
149
+ end
150
+
151
151
  if !@description.nil? && @description.to_s.length < 1
152
152
  invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
153
153
  end
@@ -158,22 +158,12 @@ module PulpContainerClient
158
158
  # Check to see if the all the properties in the model are valid
159
159
  # @return true if the model is valid
160
160
  def valid?
161
- return false if !@base_path.nil? && @base_path.to_s.length < 1
162
161
  return false if !@name.nil? && @name.to_s.length < 1
162
+ return false if !@base_path.nil? && @base_path.to_s.length < 1
163
163
  return false if !@description.nil? && @description.to_s.length < 1
164
164
  true
165
165
  end
166
166
 
167
- # Custom attribute writer method with validation
168
- # @param [Object] base_path Value to be assigned
169
- def base_path=(base_path)
170
- if !base_path.nil? && base_path.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
172
- end
173
-
174
- @base_path = base_path
175
- end
176
-
177
167
  # Custom attribute writer method with validation
178
168
  # @param [Object] name Value to be assigned
179
169
  def name=(name)
@@ -184,6 +174,16 @@ module PulpContainerClient
184
174
  @name = name
185
175
  end
186
176
 
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] base_path Value to be assigned
179
+ def base_path=(base_path)
180
+ if !base_path.nil? && base_path.to_s.length < 1
181
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
182
+ end
183
+
184
+ @base_path = base_path
185
+ end
186
+
187
187
  # Custom attribute writer method with validation
188
188
  # @param [Object] description Value to be assigned
189
189
  def description=(description)
@@ -199,12 +199,12 @@ module PulpContainerClient
199
199
  def ==(o)
200
200
  return true if self.equal?(o)
201
201
  self.class == o.class &&
202
- repository == o.repository &&
202
+ content_guard == o.content_guard &&
203
203
  pulp_labels == o.pulp_labels &&
204
+ name == o.name &&
205
+ repository == o.repository &&
204
206
  base_path == o.base_path &&
205
207
  hidden == o.hidden &&
206
- content_guard == o.content_guard &&
207
- name == o.name &&
208
208
  repository_version == o.repository_version &&
209
209
  private == o.private &&
210
210
  description == o.description
@@ -219,7 +219,7 @@ module PulpContainerClient
219
219
  # Calculates hash code according to all attributes.
220
220
  # @return [Integer] Hash code
221
221
  def hash
222
- [repository, pulp_labels, base_path, hidden, content_guard, name, repository_version, private, description].hash
222
+ [content_guard, pulp_labels, name, repository, base_path, hidden, repository_version, private, description].hash
223
223
  end
224
224
 
225
225
  # Builds the object from hash
@@ -0,0 +1,350 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ # A serializer for a specialized pull-through distribution referencing sub-distributions.
17
+ class PatchedcontainerContainerPullThroughDistribution
18
+ # An optional content-guard. If none is specified, a default one will be used.
19
+ attr_accessor :content_guard
20
+
21
+ attr_accessor :pulp_labels
22
+
23
+ # A unique name. Ex, `rawhide` and `stable`.
24
+ attr_accessor :name
25
+
26
+ # The latest RepositoryVersion for this Repository will be served.
27
+ attr_accessor :repository
28
+
29
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
30
+ attr_accessor :base_path
31
+
32
+ # Whether this distribution should be shown in the content app.
33
+ attr_accessor :hidden
34
+
35
+ # Remote that can be used to fetch content when using pull-through caching.
36
+ attr_accessor :remote
37
+
38
+ # Distributions created after pulling content through cache
39
+ attr_accessor :distributions
40
+
41
+ # Restrict pull access to explicitly authorized users. Related distributions inherit this value. Defaults to unrestricted pull access.
42
+ attr_accessor :private
43
+
44
+ # An optional description.
45
+ attr_accessor :description
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'content_guard' => :'content_guard',
51
+ :'pulp_labels' => :'pulp_labels',
52
+ :'name' => :'name',
53
+ :'repository' => :'repository',
54
+ :'base_path' => :'base_path',
55
+ :'hidden' => :'hidden',
56
+ :'remote' => :'remote',
57
+ :'distributions' => :'distributions',
58
+ :'private' => :'private',
59
+ :'description' => :'description'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'content_guard' => :'String',
67
+ :'pulp_labels' => :'Hash<String, String>',
68
+ :'name' => :'String',
69
+ :'repository' => :'String',
70
+ :'base_path' => :'String',
71
+ :'hidden' => :'Boolean',
72
+ :'remote' => :'String',
73
+ :'distributions' => :'Array<String>',
74
+ :'private' => :'Boolean',
75
+ :'description' => :'String'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ :'repository',
83
+ :'description'
84
+ ])
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ if (!attributes.is_a?(Hash))
91
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::PatchedcontainerContainerPullThroughDistribution` initialize method"
92
+ end
93
+
94
+ # check to see if the attribute exists and convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!self.class.attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::PatchedcontainerContainerPullThroughDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'content_guard')
103
+ self.content_guard = attributes[:'content_guard']
104
+ end
105
+
106
+ if attributes.key?(:'pulp_labels')
107
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
108
+ self.pulp_labels = value
109
+ end
110
+ end
111
+
112
+ if attributes.key?(:'name')
113
+ self.name = attributes[:'name']
114
+ end
115
+
116
+ if attributes.key?(:'repository')
117
+ self.repository = attributes[:'repository']
118
+ end
119
+
120
+ if attributes.key?(:'base_path')
121
+ self.base_path = attributes[:'base_path']
122
+ end
123
+
124
+ if attributes.key?(:'hidden')
125
+ self.hidden = attributes[:'hidden']
126
+ else
127
+ self.hidden = false
128
+ end
129
+
130
+ if attributes.key?(:'remote')
131
+ self.remote = attributes[:'remote']
132
+ end
133
+
134
+ if attributes.key?(:'distributions')
135
+ if (value = attributes[:'distributions']).is_a?(Array)
136
+ self.distributions = value
137
+ end
138
+ end
139
+
140
+ if attributes.key?(:'private')
141
+ self.private = attributes[:'private']
142
+ end
143
+
144
+ if attributes.key?(:'description')
145
+ self.description = attributes[:'description']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = Array.new
153
+ if !@name.nil? && @name.to_s.length < 1
154
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
155
+ end
156
+
157
+ if !@base_path.nil? && @base_path.to_s.length < 1
158
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
159
+ end
160
+
161
+ if !@description.nil? && @description.to_s.length < 1
162
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
163
+ end
164
+
165
+ invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ return false if !@name.nil? && @name.to_s.length < 1
172
+ return false if !@base_path.nil? && @base_path.to_s.length < 1
173
+ return false if !@description.nil? && @description.to_s.length < 1
174
+ true
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] name Value to be assigned
179
+ def name=(name)
180
+ if !name.nil? && name.to_s.length < 1
181
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
182
+ end
183
+
184
+ @name = name
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] base_path Value to be assigned
189
+ def base_path=(base_path)
190
+ if !base_path.nil? && base_path.to_s.length < 1
191
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
192
+ end
193
+
194
+ @base_path = base_path
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] description Value to be assigned
199
+ def description=(description)
200
+ if !description.nil? && description.to_s.length < 1
201
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
202
+ end
203
+
204
+ @description = description
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ content_guard == o.content_guard &&
213
+ pulp_labels == o.pulp_labels &&
214
+ name == o.name &&
215
+ repository == o.repository &&
216
+ base_path == o.base_path &&
217
+ hidden == o.hidden &&
218
+ remote == o.remote &&
219
+ distributions == o.distributions &&
220
+ private == o.private &&
221
+ description == o.description
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Integer] Hash code
232
+ def hash
233
+ [content_guard, pulp_labels, name, repository, base_path, hidden, remote, distributions, private, description].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def self.build_from_hash(attributes)
240
+ new.build_from_hash(attributes)
241
+ end
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def build_from_hash(attributes)
247
+ return nil unless attributes.is_a?(Hash)
248
+ self.class.openapi_types.each_pair do |key, type|
249
+ if type =~ /\AArray<(.*)>/i
250
+ # check to ensure the input is an array given that the attribute
251
+ # is documented as an array but the input is not
252
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
253
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
254
+ end
255
+ elsif !attributes[self.class.attribute_map[key]].nil?
256
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
257
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
258
+ end
259
+
260
+ self
261
+ end
262
+
263
+ # Deserializes the data based on type
264
+ # @param string type Data type
265
+ # @param string value Value to be deserialized
266
+ # @return [Object] Deserialized data
267
+ def _deserialize(type, value)
268
+ case type.to_sym
269
+ when :DateTime
270
+ DateTime.parse(value)
271
+ when :Date
272
+ Date.parse(value)
273
+ when :String
274
+ value.to_s
275
+ when :Integer
276
+ value.to_i
277
+ when :Float
278
+ value.to_f
279
+ when :Boolean
280
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
281
+ true
282
+ else
283
+ false
284
+ end
285
+ when :Object
286
+ # generic object (usually a Hash), return directly
287
+ value
288
+ when /\AArray<(?<inner_type>.+)>\z/
289
+ inner_type = Regexp.last_match[:inner_type]
290
+ value.map { |v| _deserialize(inner_type, v) }
291
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
292
+ k_type = Regexp.last_match[:k_type]
293
+ v_type = Regexp.last_match[:v_type]
294
+ {}.tap do |hash|
295
+ value.each do |k, v|
296
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
297
+ end
298
+ end
299
+ else # model
300
+ PulpContainerClient.const_get(type).build_from_hash(value)
301
+ end
302
+ end
303
+
304
+ # Returns the string representation of the object
305
+ # @return [String] String presentation of the object
306
+ def to_s
307
+ to_hash.to_s
308
+ end
309
+
310
+ # to_body is an alias to to_hash (backward compatibility)
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_body
313
+ to_hash
314
+ end
315
+
316
+ # Returns the object in the form of hash
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_hash
319
+ hash = {}
320
+ self.class.attribute_map.each_pair do |attr, param|
321
+ value = self.send(attr)
322
+ if value.nil?
323
+ is_nullable = self.class.openapi_nullable.include?(attr)
324
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
325
+ end
326
+
327
+ hash[param] = _to_hash(value)
328
+ end
329
+ hash
330
+ end
331
+
332
+ # Outputs non-array value in the form of hash
333
+ # For object, use to_hash. Otherwise, just return the value
334
+ # @param [Object] value Any valid value
335
+ # @return [Hash] Returns the value in the form of hash
336
+ def _to_hash(value)
337
+ if value.is_a?(Array)
338
+ value.compact.map { |v| _to_hash(v) }
339
+ elsif value.is_a?(Hash)
340
+ {}.tap do |hash|
341
+ value.each { |k, v| hash[k] = _to_hash(v) }
342
+ end
343
+ elsif value.respond_to? :to_hash
344
+ value.to_hash
345
+ else
346
+ value
347
+ end
348
+ end
349
+ end
350
+ end