pulp_file_client 1.8.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +21 -15
  4. data/docs/AcsFileApi.md +416 -0
  5. data/docs/ContentFilesApi.md +1 -1
  6. data/docs/DistributionsFileApi.md +1 -1
  7. data/docs/FileFileAlternateContentSource.md +23 -0
  8. data/docs/FileFileAlternateContentSourceResponse.md +27 -0
  9. data/docs/FileFileRemote.md +7 -5
  10. data/docs/FileFileRemoteResponse.md +7 -5
  11. data/docs/FileFileRepository.md +3 -3
  12. data/docs/FileFileRepositoryResponse.md +3 -3
  13. data/docs/PaginatedfileFileAlternateContentSourceResponseList.md +23 -0
  14. data/docs/PatchedfileFileAlternateContentSource.md +23 -0
  15. data/docs/PatchedfileFileRemote.md +7 -5
  16. data/docs/PatchedfileFileRepository.md +3 -3
  17. data/docs/PublicationsFileApi.md +1 -1
  18. data/docs/RemotesFileApi.md +1 -1
  19. data/docs/RepositoriesFileApi.md +1 -1
  20. data/docs/RepositoriesFileVersionsApi.md +1 -1
  21. data/docs/RepositoryAddRemoveContent.md +2 -2
  22. data/lib/pulp_file_client/api/acs_file_api.rb +508 -0
  23. data/lib/pulp_file_client/api/content_files_api.rb +1 -1
  24. data/lib/pulp_file_client/api/distributions_file_api.rb +1 -1
  25. data/lib/pulp_file_client/api/publications_file_api.rb +1 -1
  26. data/lib/pulp_file_client/api/remotes_file_api.rb +1 -1
  27. data/lib/pulp_file_client/api/repositories_file_api.rb +1 -1
  28. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +1 -1
  29. data/lib/pulp_file_client/api_client.rb +12 -8
  30. data/lib/pulp_file_client/api_error.rb +1 -1
  31. data/lib/pulp_file_client/configuration.rb +10 -3
  32. data/lib/pulp_file_client/models/async_operation_response.rb +1 -1
  33. data/lib/pulp_file_client/models/content_summary.rb +1 -1
  34. data/lib/pulp_file_client/models/content_summary_response.rb +1 -1
  35. data/lib/pulp_file_client/models/file_file_alternate_content_source.rb +251 -0
  36. data/lib/pulp_file_client/models/file_file_alternate_content_source_response.rb +270 -0
  37. data/lib/pulp_file_client/models/file_file_content.rb +1 -1
  38. data/lib/pulp_file_client/models/file_file_content_response.rb +1 -1
  39. data/lib/pulp_file_client/models/file_file_distribution.rb +1 -1
  40. data/lib/pulp_file_client/models/file_file_distribution_response.rb +1 -1
  41. data/lib/pulp_file_client/models/file_file_publication.rb +1 -1
  42. data/lib/pulp_file_client/models/file_file_publication_response.rb +1 -1
  43. data/lib/pulp_file_client/models/file_file_remote.rb +19 -7
  44. data/lib/pulp_file_client/models/file_file_remote_response.rb +19 -7
  45. data/lib/pulp_file_client/models/file_file_repository.rb +18 -17
  46. data/lib/pulp_file_client/models/file_file_repository_response.rb +18 -17
  47. data/lib/pulp_file_client/models/paginated_repository_version_response_list.rb +1 -1
  48. data/lib/pulp_file_client/models/paginatedfile_file_alternate_content_source_response_list.rb +237 -0
  49. data/lib/pulp_file_client/models/paginatedfile_file_content_response_list.rb +1 -1
  50. data/lib/pulp_file_client/models/paginatedfile_file_distribution_response_list.rb +1 -1
  51. data/lib/pulp_file_client/models/paginatedfile_file_publication_response_list.rb +1 -1
  52. data/lib/pulp_file_client/models/paginatedfile_file_remote_response_list.rb +1 -1
  53. data/lib/pulp_file_client/models/paginatedfile_file_repository_response_list.rb +1 -1
  54. data/lib/pulp_file_client/models/patchedfile_file_alternate_content_source.rb +241 -0
  55. data/lib/pulp_file_client/models/patchedfile_file_distribution.rb +1 -1
  56. data/lib/pulp_file_client/models/patchedfile_file_remote.rb +19 -7
  57. data/lib/pulp_file_client/models/patchedfile_file_repository.rb +18 -17
  58. data/lib/pulp_file_client/models/policy_enum.rb +1 -1
  59. data/lib/pulp_file_client/models/repository_add_remove_content.rb +3 -3
  60. data/lib/pulp_file_client/models/repository_sync_url.rb +1 -1
  61. data/lib/pulp_file_client/models/repository_version.rb +1 -1
  62. data/lib/pulp_file_client/models/repository_version_response.rb +1 -1
  63. data/lib/pulp_file_client/version.rb +2 -2
  64. data/lib/pulp_file_client.rb +6 -1
  65. data/pulp_file_client.gemspec +1 -1
  66. data/spec/api/acs_file_api_spec.rb +132 -0
  67. data/spec/api/content_files_api_spec.rb +1 -1
  68. data/spec/api/distributions_file_api_spec.rb +1 -1
  69. data/spec/api/publications_file_api_spec.rb +1 -1
  70. data/spec/api/remotes_file_api_spec.rb +1 -1
  71. data/spec/api/repositories_file_api_spec.rb +1 -1
  72. data/spec/api/repositories_file_versions_api_spec.rb +1 -1
  73. data/spec/api_client_spec.rb +2 -2
  74. data/spec/configuration_spec.rb +4 -4
  75. data/spec/models/async_operation_response_spec.rb +1 -1
  76. data/spec/models/content_summary_response_spec.rb +1 -1
  77. data/spec/models/content_summary_spec.rb +1 -1
  78. data/spec/models/file_file_alternate_content_source_response_spec.rb +71 -0
  79. data/spec/models/file_file_alternate_content_source_spec.rb +59 -0
  80. data/spec/models/file_file_content_response_spec.rb +1 -1
  81. data/spec/models/file_file_content_spec.rb +1 -1
  82. data/spec/models/file_file_distribution_response_spec.rb +1 -1
  83. data/spec/models/file_file_distribution_spec.rb +1 -1
  84. data/spec/models/file_file_publication_response_spec.rb +1 -1
  85. data/spec/models/file_file_publication_spec.rb +1 -1
  86. data/spec/models/file_file_remote_response_spec.rb +7 -1
  87. data/spec/models/file_file_remote_spec.rb +7 -1
  88. data/spec/models/file_file_repository_response_spec.rb +2 -2
  89. data/spec/models/file_file_repository_spec.rb +2 -2
  90. data/spec/models/paginated_repository_version_response_list_spec.rb +1 -1
  91. data/spec/models/paginatedfile_file_alternate_content_source_response_list_spec.rb +59 -0
  92. data/spec/models/paginatedfile_file_content_response_list_spec.rb +1 -1
  93. data/spec/models/paginatedfile_file_distribution_response_list_spec.rb +1 -1
  94. data/spec/models/paginatedfile_file_publication_response_list_spec.rb +1 -1
  95. data/spec/models/paginatedfile_file_remote_response_list_spec.rb +1 -1
  96. data/spec/models/paginatedfile_file_repository_response_list_spec.rb +1 -1
  97. data/spec/models/patchedfile_file_alternate_content_source_spec.rb +59 -0
  98. data/spec/models/patchedfile_file_distribution_spec.rb +1 -1
  99. data/spec/models/patchedfile_file_remote_spec.rb +7 -1
  100. data/spec/models/patchedfile_file_repository_spec.rb +2 -2
  101. data/spec/models/policy_enum_spec.rb +1 -1
  102. data/spec/models/repository_add_remove_content_spec.rb +1 -1
  103. data/spec/models/repository_sync_url_spec.rb +1 -1
  104. data/spec/models/repository_version_response_spec.rb +1 -1
  105. data/spec/models/repository_version_spec.rb +1 -1
  106. data/spec/spec_helper.rb +1 -1
  107. metadata +43 -23
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,237 @@
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 PulpFileClient
16
+ class PaginatedfileFileAlternateContentSourceResponseList
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<FileFileAlternateContentSourceResponse>'
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 `PulpFileClient::PaginatedfileFileAlternateContentSourceResponseList` 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 `PulpFileClient::PaginatedfileFileAlternateContentSourceResponseList`. 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
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ count == o.count &&
106
+ _next == o._next &&
107
+ previous == o.previous &&
108
+ results == o.results
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [count, _next, previous, results].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ PulpFileClient.const_get(type).build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,241 @@
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 PulpFileClient
16
+ # Serializer for File alternate content source.
17
+ class PatchedfileFileAlternateContentSource
18
+ # Name of Alternate Content Source.
19
+ attr_accessor :name
20
+
21
+ # Date of last refresh of AlternateContentSource.
22
+ attr_accessor :last_refreshed
23
+
24
+ # List of paths that will be appended to the Remote url when searching for content.
25
+ attr_accessor :paths
26
+
27
+ # The remote to provide alternate content source.
28
+ attr_accessor :remote
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'last_refreshed' => :'last_refreshed',
35
+ :'paths' => :'paths',
36
+ :'remote' => :'remote'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'name' => :'String',
44
+ :'last_refreshed' => :'DateTime',
45
+ :'paths' => :'Array<String>',
46
+ :'remote' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'last_refreshed',
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::PatchedfileFileAlternateContentSource` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::PatchedfileFileAlternateContentSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'last_refreshed')
77
+ self.last_refreshed = attributes[:'last_refreshed']
78
+ end
79
+
80
+ if attributes.key?(:'paths')
81
+ if (value = attributes[:'paths']).is_a?(Array)
82
+ self.paths = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'remote')
87
+ self.remote = attributes[:'remote']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ name == o.name &&
110
+ last_refreshed == o.last_refreshed &&
111
+ paths == o.paths &&
112
+ remote == o.remote
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [name, last_refreshed, paths, remote].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ new.build_from_hash(attributes)
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ self.class.openapi_types.each_pair do |key, type|
140
+ if type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
+ end
146
+ elsif !attributes[self.class.attribute_map[key]].nil?
147
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :DateTime
161
+ DateTime.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ PulpFileClient.const_get(type).build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+ end
241
+ end