pulp_rpm_client 3.16.2 → 3.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -12
- data/docs/AcsRpmApi.md +417 -0
- data/docs/CompsXml.md +21 -0
- data/docs/PaginatedrpmRpmAlternateContentSourceResponseList.md +23 -0
- data/docs/PatchedrpmRpmAlternateContentSource.md +23 -0
- data/docs/RpmCompsApi.md +68 -0
- data/docs/RpmRpmAlternateContentSource.md +23 -0
- data/docs/RpmRpmAlternateContentSourceResponse.md +27 -0
- data/docs/TaskGroupOperationResponse.md +17 -0
- data/lib/pulp_rpm_client/api/acs_rpm_api.rb +510 -0
- data/lib/pulp_rpm_client/api/rpm_comps_api.rb +93 -0
- data/lib/pulp_rpm_client/models/comps_xml.rb +233 -0
- data/lib/pulp_rpm_client/models/paginatedrpm_rpm_alternate_content_source_response_list.rb +237 -0
- data/lib/pulp_rpm_client/models/patchedrpm_rpm_alternate_content_source.rb +256 -0
- data/lib/pulp_rpm_client/models/rpm_rpm_alternate_content_source.rb +270 -0
- data/lib/pulp_rpm_client/models/rpm_rpm_alternate_content_source_response.rb +270 -0
- data/lib/pulp_rpm_client/models/task_group_operation_response.rb +213 -0
- data/lib/pulp_rpm_client/version.rb +1 -1
- data/lib/pulp_rpm_client.rb +8 -0
- data/pulp_rpm_client.gemspec +1 -1
- data/spec/api/acs_rpm_api_spec.rb +132 -0
- data/spec/api/rpm_comps_api_spec.rb +49 -0
- data/spec/models/comps_xml_spec.rb +53 -0
- data/spec/models/paginatedrpm_rpm_alternate_content_source_response_list_spec.rb +59 -0
- data/spec/models/patchedrpm_rpm_alternate_content_source_spec.rb +59 -0
- data/spec/models/rpm_rpm_alternate_content_source_response_spec.rb +71 -0
- data/spec/models/rpm_rpm_alternate_content_source_spec.rb +59 -0
- data/spec/models/task_group_operation_response_spec.rb +41 -0
- metadata +107 -69
@@ -0,0 +1,256 @@
|
|
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 PulpRpmClient
|
16
|
+
# Serializer for RPM alternate content source.
|
17
|
+
class PatchedrpmRpmAlternateContentSource
|
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 `PulpRpmClient::PatchedrpmRpmAlternateContentSource` 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 `PulpRpmClient::PatchedrpmRpmAlternateContentSource`. 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
|
+
if !@name.nil? && @name.to_s.length < 1
|
96
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
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 !@name.nil? && @name.to_s.length < 1
|
106
|
+
true
|
107
|
+
end
|
108
|
+
|
109
|
+
# Custom attribute writer method with validation
|
110
|
+
# @param [Object] name Value to be assigned
|
111
|
+
def name=(name)
|
112
|
+
if !name.nil? && name.to_s.length < 1
|
113
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
114
|
+
end
|
115
|
+
|
116
|
+
@name = name
|
117
|
+
end
|
118
|
+
|
119
|
+
# Checks equality by comparing each attribute.
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def ==(o)
|
122
|
+
return true if self.equal?(o)
|
123
|
+
self.class == o.class &&
|
124
|
+
name == o.name &&
|
125
|
+
last_refreshed == o.last_refreshed &&
|
126
|
+
paths == o.paths &&
|
127
|
+
remote == o.remote
|
128
|
+
end
|
129
|
+
|
130
|
+
# @see the `==` method
|
131
|
+
# @param [Object] Object to be compared
|
132
|
+
def eql?(o)
|
133
|
+
self == o
|
134
|
+
end
|
135
|
+
|
136
|
+
# Calculates hash code according to all attributes.
|
137
|
+
# @return [Integer] Hash code
|
138
|
+
def hash
|
139
|
+
[name, last_refreshed, paths, remote].hash
|
140
|
+
end
|
141
|
+
|
142
|
+
# Builds the object from hash
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
# @return [Object] Returns the model itself
|
145
|
+
def self.build_from_hash(attributes)
|
146
|
+
new.build_from_hash(attributes)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Builds the object from hash
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
151
|
+
# @return [Object] Returns the model itself
|
152
|
+
def build_from_hash(attributes)
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
154
|
+
self.class.openapi_types.each_pair do |key, type|
|
155
|
+
if type =~ /\AArray<(.*)>/i
|
156
|
+
# check to ensure the input is an array given that the attribute
|
157
|
+
# is documented as an array but the input is not
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
160
|
+
end
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
163
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
164
|
+
end
|
165
|
+
|
166
|
+
self
|
167
|
+
end
|
168
|
+
|
169
|
+
# Deserializes the data based on type
|
170
|
+
# @param string type Data type
|
171
|
+
# @param string value Value to be deserialized
|
172
|
+
# @return [Object] Deserialized data
|
173
|
+
def _deserialize(type, value)
|
174
|
+
case type.to_sym
|
175
|
+
when :DateTime
|
176
|
+
DateTime.parse(value)
|
177
|
+
when :Date
|
178
|
+
Date.parse(value)
|
179
|
+
when :String
|
180
|
+
value.to_s
|
181
|
+
when :Integer
|
182
|
+
value.to_i
|
183
|
+
when :Float
|
184
|
+
value.to_f
|
185
|
+
when :Boolean
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
187
|
+
true
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
when :Object
|
192
|
+
# generic object (usually a Hash), return directly
|
193
|
+
value
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each do |k, v|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
else # model
|
206
|
+
PulpRpmClient.const_get(type).build_from_hash(value)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the string representation of the object
|
211
|
+
# @return [String] String presentation of the object
|
212
|
+
def to_s
|
213
|
+
to_hash.to_s
|
214
|
+
end
|
215
|
+
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_body
|
219
|
+
to_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the object in the form of hash
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_hash
|
225
|
+
hash = {}
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
227
|
+
value = self.send(attr)
|
228
|
+
if value.nil?
|
229
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
230
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
231
|
+
end
|
232
|
+
|
233
|
+
hash[param] = _to_hash(value)
|
234
|
+
end
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
@@ -0,0 +1,270 @@
|
|
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 PulpRpmClient
|
16
|
+
# Serializer for RPM alternate content source.
|
17
|
+
class RpmRpmAlternateContentSource
|
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 `PulpRpmClient::RpmRpmAlternateContentSource` 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 `PulpRpmClient::RpmRpmAlternateContentSource`. 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
|
+
if @name.nil?
|
96
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
97
|
+
end
|
98
|
+
|
99
|
+
if @name.to_s.length < 1
|
100
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
101
|
+
end
|
102
|
+
|
103
|
+
if @remote.nil?
|
104
|
+
invalid_properties.push('invalid value for "remote", remote cannot be nil.')
|
105
|
+
end
|
106
|
+
|
107
|
+
invalid_properties
|
108
|
+
end
|
109
|
+
|
110
|
+
# Check to see if the all the properties in the model are valid
|
111
|
+
# @return true if the model is valid
|
112
|
+
def valid?
|
113
|
+
return false if @name.nil?
|
114
|
+
return false if @name.to_s.length < 1
|
115
|
+
return false if @remote.nil?
|
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
|
+
# Checks equality by comparing each attribute.
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def ==(o)
|
136
|
+
return true if self.equal?(o)
|
137
|
+
self.class == o.class &&
|
138
|
+
name == o.name &&
|
139
|
+
last_refreshed == o.last_refreshed &&
|
140
|
+
paths == o.paths &&
|
141
|
+
remote == o.remote
|
142
|
+
end
|
143
|
+
|
144
|
+
# @see the `==` method
|
145
|
+
# @param [Object] Object to be compared
|
146
|
+
def eql?(o)
|
147
|
+
self == o
|
148
|
+
end
|
149
|
+
|
150
|
+
# Calculates hash code according to all attributes.
|
151
|
+
# @return [Integer] Hash code
|
152
|
+
def hash
|
153
|
+
[name, last_refreshed, paths, remote].hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Builds the object from hash
|
157
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
158
|
+
# @return [Object] Returns the model itself
|
159
|
+
def self.build_from_hash(attributes)
|
160
|
+
new.build_from_hash(attributes)
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def build_from_hash(attributes)
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
168
|
+
self.class.openapi_types.each_pair do |key, type|
|
169
|
+
if type =~ /\AArray<(.*)>/i
|
170
|
+
# check to ensure the input is an array given that the attribute
|
171
|
+
# is documented as an array but the input is not
|
172
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
173
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
174
|
+
end
|
175
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
176
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
177
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
178
|
+
end
|
179
|
+
|
180
|
+
self
|
181
|
+
end
|
182
|
+
|
183
|
+
# Deserializes the data based on type
|
184
|
+
# @param string type Data type
|
185
|
+
# @param string value Value to be deserialized
|
186
|
+
# @return [Object] Deserialized data
|
187
|
+
def _deserialize(type, value)
|
188
|
+
case type.to_sym
|
189
|
+
when :DateTime
|
190
|
+
DateTime.parse(value)
|
191
|
+
when :Date
|
192
|
+
Date.parse(value)
|
193
|
+
when :String
|
194
|
+
value.to_s
|
195
|
+
when :Integer
|
196
|
+
value.to_i
|
197
|
+
when :Float
|
198
|
+
value.to_f
|
199
|
+
when :Boolean
|
200
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
201
|
+
true
|
202
|
+
else
|
203
|
+
false
|
204
|
+
end
|
205
|
+
when :Object
|
206
|
+
# generic object (usually a Hash), return directly
|
207
|
+
value
|
208
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
209
|
+
inner_type = Regexp.last_match[:inner_type]
|
210
|
+
value.map { |v| _deserialize(inner_type, v) }
|
211
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
212
|
+
k_type = Regexp.last_match[:k_type]
|
213
|
+
v_type = Regexp.last_match[:v_type]
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each do |k, v|
|
216
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
else # model
|
220
|
+
PulpRpmClient.const_get(type).build_from_hash(value)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the string representation of the object
|
225
|
+
# @return [String] String presentation of the object
|
226
|
+
def to_s
|
227
|
+
to_hash.to_s
|
228
|
+
end
|
229
|
+
|
230
|
+
# to_body is an alias to to_hash (backward compatibility)
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
232
|
+
def to_body
|
233
|
+
to_hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns the object in the form of hash
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_hash
|
239
|
+
hash = {}
|
240
|
+
self.class.attribute_map.each_pair do |attr, param|
|
241
|
+
value = self.send(attr)
|
242
|
+
if value.nil?
|
243
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
244
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
245
|
+
end
|
246
|
+
|
247
|
+
hash[param] = _to_hash(value)
|
248
|
+
end
|
249
|
+
hash
|
250
|
+
end
|
251
|
+
|
252
|
+
# Outputs non-array value in the form of hash
|
253
|
+
# For object, use to_hash. Otherwise, just return the value
|
254
|
+
# @param [Object] value Any valid value
|
255
|
+
# @return [Hash] Returns the value in the form of hash
|
256
|
+
def _to_hash(value)
|
257
|
+
if value.is_a?(Array)
|
258
|
+
value.compact.map { |v| _to_hash(v) }
|
259
|
+
elsif value.is_a?(Hash)
|
260
|
+
{}.tap do |hash|
|
261
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
262
|
+
end
|
263
|
+
elsif value.respond_to? :to_hash
|
264
|
+
value.to_hash
|
265
|
+
else
|
266
|
+
value
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|