togglr-sdk 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/togglr/client.rb +2 -9
  3. data/lib/togglr/version.rb +1 -1
  4. metadata +1 -51
  5. data/generated/Gemfile +0 -9
  6. data/generated/README.md +0 -121
  7. data/generated/Rakefile +0 -10
  8. data/generated/docs/DefaultApi.md +0 -282
  9. data/generated/docs/Error.md +0 -18
  10. data/generated/docs/ErrorBadRequest.md +0 -18
  11. data/generated/docs/ErrorError.md +0 -18
  12. data/generated/docs/ErrorInternalServerError.md +0 -18
  13. data/generated/docs/ErrorNotFound.md +0 -18
  14. data/generated/docs/ErrorPermissionDenied.md +0 -18
  15. data/generated/docs/ErrorTooManyRequests.md +0 -18
  16. data/generated/docs/ErrorUnauthorized.md +0 -18
  17. data/generated/docs/EvaluateResponse.md +0 -22
  18. data/generated/docs/FeatureErrorReport.md +0 -22
  19. data/generated/docs/FeatureHealth.md +0 -30
  20. data/generated/docs/HealthResponse.md +0 -20
  21. data/generated/git_push.sh +0 -57
  22. data/generated/lib/togglr-client/api/default_api.rb +0 -284
  23. data/generated/lib/togglr-client/api_client.rb +0 -437
  24. data/generated/lib/togglr-client/api_error.rb +0 -58
  25. data/generated/lib/togglr-client/configuration.rb +0 -392
  26. data/generated/lib/togglr-client/models/error.rb +0 -237
  27. data/generated/lib/togglr-client/models/error_bad_request.rb +0 -244
  28. data/generated/lib/togglr-client/models/error_error.rb +0 -220
  29. data/generated/lib/togglr-client/models/error_internal_server_error.rb +0 -244
  30. data/generated/lib/togglr-client/models/error_not_found.rb +0 -244
  31. data/generated/lib/togglr-client/models/error_permission_denied.rb +0 -244
  32. data/generated/lib/togglr-client/models/error_too_many_requests.rb +0 -244
  33. data/generated/lib/togglr-client/models/error_unauthorized.rb +0 -244
  34. data/generated/lib/togglr-client/models/evaluate_response.rb +0 -289
  35. data/generated/lib/togglr-client/models/feature_error_report.rb +0 -274
  36. data/generated/lib/togglr-client/models/feature_health.rb +0 -342
  37. data/generated/lib/togglr-client/models/health_response.rb +0 -287
  38. data/generated/lib/togglr-client/version.rb +0 -15
  39. data/generated/lib/togglr-client.rb +0 -52
  40. data/generated/spec/api/default_api_spec.rb +0 -81
  41. data/generated/spec/models/error_bad_request_spec.rb +0 -36
  42. data/generated/spec/models/error_error_spec.rb +0 -36
  43. data/generated/spec/models/error_internal_server_error_spec.rb +0 -36
  44. data/generated/spec/models/error_not_found_spec.rb +0 -36
  45. data/generated/spec/models/error_permission_denied_spec.rb +0 -36
  46. data/generated/spec/models/error_spec.rb +0 -36
  47. data/generated/spec/models/error_too_many_requests_spec.rb +0 -36
  48. data/generated/spec/models/error_unauthorized_spec.rb +0 -36
  49. data/generated/spec/models/evaluate_response_spec.rb +0 -48
  50. data/generated/spec/models/feature_error_report_spec.rb +0 -48
  51. data/generated/spec/models/feature_health_spec.rb +0 -72
  52. data/generated/spec/models/health_response_spec.rb +0 -46
  53. data/generated/spec/spec_helper.rb +0 -111
  54. data/generated/togglr-client.gemspec +0 -41
@@ -1,392 +0,0 @@
1
- =begin
2
- #SDK API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.15.0
10
-
11
- =end
12
-
13
- module TogglrClient
14
- class Configuration
15
- # Defines url scheme
16
- attr_accessor :scheme
17
-
18
- # Defines url host
19
- attr_accessor :host
20
-
21
- # Defines url base path
22
- attr_accessor :base_path
23
-
24
- # Define server configuration index
25
- attr_accessor :server_index
26
-
27
- # Define server operation configuration index
28
- attr_accessor :server_operation_index
29
-
30
- # Default server variables
31
- attr_accessor :server_variables
32
-
33
- # Default server operation variables
34
- attr_accessor :server_operation_variables
35
-
36
- # Defines API keys used with API Key authentications.
37
- #
38
- # @return [Hash] key: parameter name, value: parameter value (API key)
39
- #
40
- # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
- # config.api_key['api_key'] = 'xxx'
42
- attr_accessor :api_key
43
-
44
- # Defines API key prefixes used with API Key authentications.
45
- #
46
- # @return [Hash] key: parameter name, value: API key prefix
47
- #
48
- # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
- # config.api_key_prefix['api_key'] = 'Token'
50
- attr_accessor :api_key_prefix
51
-
52
- # Defines the username used with HTTP basic authentication.
53
- #
54
- # @return [String]
55
- attr_accessor :username
56
-
57
- # Defines the password used with HTTP basic authentication.
58
- #
59
- # @return [String]
60
- attr_accessor :password
61
-
62
- # Defines the access token (Bearer) used with OAuth2.
63
- attr_accessor :access_token
64
-
65
- # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
66
- # Overrides the access_token if set
67
- # @return [Proc]
68
- attr_accessor :access_token_getter
69
-
70
- # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
- # HTTP responses with return type `File` will be returned as a stream of binary data.
72
- # Default to false.
73
- attr_accessor :return_binary_data
74
-
75
- # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
76
- # details will be logged with `logger.debug` (see the `logger` attribute).
77
- # Default to false.
78
- #
79
- # @return [true, false]
80
- attr_accessor :debugging
81
-
82
- # Set this to ignore operation servers for the API client. This is useful when you need to
83
- # send requests to a different server than the one specified in the OpenAPI document.
84
- # Will default to the base url defined in the spec but can be overridden by setting
85
- # `scheme`, `host`, `base_path` directly.
86
- # Default to false.
87
- # @return [true, false]
88
- attr_accessor :ignore_operation_servers
89
-
90
- # Defines the logger used for debugging.
91
- # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
92
- #
93
- # @return [#debug]
94
- attr_accessor :logger
95
-
96
- # Defines the temporary folder to store downloaded files
97
- # (for API endpoints that have file response).
98
- # Default to use `Tempfile`.
99
- #
100
- # @return [String]
101
- attr_accessor :temp_folder_path
102
-
103
- # The time limit for HTTP request in seconds.
104
- # Default to 0 (never times out).
105
- attr_accessor :timeout
106
-
107
- # Set this to false to skip client side validation in the operation.
108
- # Default to true.
109
- # @return [true, false]
110
- attr_accessor :client_side_validation
111
-
112
- ### TLS/SSL setting
113
- # Set this to false to skip verifying SSL certificate when calling API from https server.
114
- # Default to true.
115
- #
116
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
117
- #
118
- # @return [true, false]
119
- attr_accessor :ssl_verify
120
-
121
- ### TLS/SSL setting
122
- # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
123
- #
124
- # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
125
- #
126
- attr_accessor :ssl_verify_mode
127
-
128
- ### TLS/SSL setting
129
- # Set this to customize the certificate file to verify the peer.
130
- #
131
- # @return [String] the path to the certificate file
132
- attr_accessor :ssl_ca_file
133
-
134
- ### TLS/SSL setting
135
- # Client certificate file (for client certificate)
136
- attr_accessor :ssl_client_cert
137
-
138
- ### TLS/SSL setting
139
- # Client private key file (for client certificate)
140
- attr_accessor :ssl_client_key
141
-
142
- ### Proxy setting
143
- # HTTP Proxy settings
144
- attr_accessor :proxy
145
-
146
- # Set this to customize parameters encoder of array parameter.
147
- # Default to nil. Faraday uses NestedParamsEncoder when nil.
148
- #
149
- # @see The params_encoder option of Faraday. Related source code:
150
- # https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
151
- attr_accessor :params_encoder
152
-
153
-
154
- attr_accessor :inject_format
155
-
156
- attr_accessor :force_ending_format
157
-
158
- def initialize
159
- @scheme = 'http'
160
- @host = 'localhost:8090'
161
- @base_path = ''
162
- @server_index = nil
163
- @server_operation_index = {}
164
- @server_variables = {}
165
- @server_operation_variables = {}
166
- @api_key = {}
167
- @api_key_prefix = {}
168
- @client_side_validation = true
169
- @ssl_verify = true
170
- @ssl_verify_mode = nil
171
- @ssl_ca_file = nil
172
- @ssl_client_cert = nil
173
- @ssl_client_key = nil
174
- @middlewares = Hash.new { |h, k| h[k] = [] }
175
- @configure_connection_blocks = []
176
- @timeout = 60
177
- # return data as binary instead of file
178
- @return_binary_data = false
179
- @params_encoder = nil
180
- @debugging = false
181
- @ignore_operation_servers = false
182
- @inject_format = false
183
- @force_ending_format = false
184
- @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
185
-
186
- yield(self) if block_given?
187
- end
188
-
189
- # The default Configuration object.
190
- def self.default
191
- @@default ||= Configuration.new
192
- end
193
-
194
- def configure
195
- yield(self) if block_given?
196
- end
197
-
198
- def scheme=(scheme)
199
- # remove :// from scheme
200
- @scheme = scheme.sub(/:\/\//, '')
201
- end
202
-
203
- def host=(host)
204
- # remove http(s):// and anything after a slash
205
- @host = host.sub(/https?:\/\//, '').split('/').first
206
- end
207
-
208
- def base_path=(base_path)
209
- # Add leading and trailing slashes to base_path
210
- @base_path = "/#{base_path}".gsub(/\/+/, '/')
211
- @base_path = '' if @base_path == '/'
212
- end
213
-
214
- # Returns base URL for specified operation based on server settings
215
- def base_url(operation = nil)
216
- return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
217
- if operation_server_settings.key?(operation) then
218
- index = server_operation_index.fetch(operation, server_index)
219
- server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
220
- else
221
- server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
222
- end
223
- end
224
-
225
- # Gets API key (with prefix if set).
226
- # @param [String] param_name the parameter name of API key auth
227
- def api_key_with_prefix(param_name, param_alias = nil)
228
- key = @api_key[param_name]
229
- key = @api_key.fetch(param_alias, key) unless param_alias.nil?
230
- if @api_key_prefix[param_name]
231
- "#{@api_key_prefix[param_name]} #{key}"
232
- else
233
- key
234
- end
235
- end
236
-
237
- # Gets access_token using access_token_getter or uses the static access_token
238
- def access_token_with_refresh
239
- return access_token if access_token_getter.nil?
240
- access_token_getter.call
241
- end
242
-
243
- # Gets Basic Auth token string
244
- def basic_auth_token
245
- 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
246
- end
247
-
248
- # Returns Auth Settings hash for api client.
249
- def auth_settings
250
- {
251
- 'ApiKeyAuth' =>
252
- {
253
- type: 'api_key',
254
- in: 'header',
255
- key: 'Authorization',
256
- value: api_key_with_prefix('Authorization')
257
- },
258
- }
259
- end
260
-
261
- # Returns an array of Server setting
262
- def server_settings
263
- [
264
- {
265
- url: "http://localhost:8090",
266
- description: "Dev backend",
267
- }
268
- ]
269
- end
270
-
271
- def operation_server_settings
272
- {
273
- }
274
- end
275
-
276
- # Returns URL based on server settings
277
- #
278
- # @param index array index of the server settings
279
- # @param variables hash of variable and the corresponding value
280
- def server_url(index, variables = {}, servers = nil)
281
- servers = server_settings if servers == nil
282
-
283
- # check array index out of bound
284
- if (index.nil? || index < 0 || index >= servers.size)
285
- fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
286
- end
287
-
288
- server = servers[index]
289
- url = server[:url]
290
-
291
- return url unless server.key? :variables
292
-
293
- # go through variable and assign a value
294
- server[:variables].each do |name, variable|
295
- if variables.key?(name)
296
- if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
297
- url.gsub! "{" + name.to_s + "}", variables[name]
298
- else
299
- fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
300
- end
301
- else
302
- # use default value
303
- url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
304
- end
305
- end
306
-
307
- url
308
- end
309
-
310
- # Configure Faraday connection directly.
311
- #
312
- # ```
313
- # c.configure_faraday_connection do |conn|
314
- # conn.use Faraday::HttpCache, shared_cache: false, logger: logger
315
- # conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
316
- # logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
317
- # end
318
- # end
319
- #
320
- # c.configure_faraday_connection do |conn|
321
- # conn.adapter :typhoeus
322
- # end
323
- # ```
324
- #
325
- # @param block [Proc] `#call`able object that takes one arg, the connection
326
- def configure_faraday_connection(&block)
327
- @configure_connection_blocks << block
328
- end
329
-
330
- def configure_connection(conn)
331
- @configure_connection_blocks.each do |block|
332
- block.call(conn)
333
- end
334
- end
335
-
336
- # Adds middleware to the stack
337
- def use(*middleware)
338
- set_faraday_middleware(:use, *middleware)
339
- end
340
-
341
- # Adds request middleware to the stack
342
- def request(*middleware)
343
- set_faraday_middleware(:request, *middleware)
344
- end
345
-
346
- # Adds response middleware to the stack
347
- def response(*middleware)
348
- set_faraday_middleware(:response, *middleware)
349
- end
350
-
351
- # Adds Faraday middleware setting information to the stack
352
- #
353
- # @example Use the `set_faraday_middleware` method to set middleware information
354
- # config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
355
- # config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
356
- # config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
357
- # config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
358
- # config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
359
- # config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
360
- #
361
- # @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
362
- def set_faraday_middleware(operation, key, *args, &block)
363
- unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
364
- fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
365
- " :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
366
- end
367
-
368
- @middlewares[operation] << [key, args, block]
369
- end
370
- ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
371
-
372
- # Set up middleware on the connection
373
- def configure_middleware(connection)
374
- return if @middlewares.empty?
375
-
376
- [:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
377
- next unless @middlewares.key?(operation)
378
-
379
- @middlewares[operation].each do |key, args, block|
380
- connection.builder.send(operation, key, *args, &block)
381
- end
382
- end
383
-
384
- if @middlewares.key?(:delete)
385
- @middlewares[:delete].each do |key, _args, _block|
386
- connection.builder.delete(key)
387
- end
388
- end
389
- end
390
-
391
- end
392
- end
@@ -1,237 +0,0 @@
1
- =begin
2
- #SDK API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.15.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module TogglrClient
17
- class Error
18
- attr_accessor :error
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'error' => :'error'
24
- }
25
- end
26
-
27
- # Returns attribute mapping this model knows about
28
- def self.acceptable_attribute_map
29
- attribute_map
30
- end
31
-
32
- # Returns all the JSON keys this model knows about
33
- def self.acceptable_attributes
34
- acceptable_attribute_map.values
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.openapi_types
39
- {
40
- :'error' => :'ErrorError'
41
- }
42
- end
43
-
44
- # List of attributes with nullable: true
45
- def self.openapi_nullable
46
- Set.new([
47
- ])
48
- end
49
-
50
- # Initializes the object
51
- # @param [Hash] attributes Model attributes in the form of hash
52
- def initialize(attributes = {})
53
- if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `TogglrClient::Error` initialize method"
55
- end
56
-
57
- # check to see if the attribute exists and convert string to symbol for hash key
58
- acceptable_attribute_map = self.class.acceptable_attribute_map
59
- attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `TogglrClient::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
- end
63
- h[k.to_sym] = v
64
- }
65
-
66
- if attributes.key?(:'error')
67
- self.error = attributes[:'error']
68
- else
69
- self.error = nil
70
- end
71
- end
72
-
73
- # Show invalid properties with the reasons. Usually used together with valid?
74
- # @return Array for valid properties with the reasons
75
- def list_invalid_properties
76
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
- invalid_properties = Array.new
78
- if @error.nil?
79
- invalid_properties.push('invalid value for "error", error cannot be nil.')
80
- end
81
-
82
- invalid_properties
83
- end
84
-
85
- # Check to see if the all the properties in the model are valid
86
- # @return true if the model is valid
87
- def valid?
88
- warn '[DEPRECATED] the `valid?` method is obsolete'
89
- return false if @error.nil?
90
- true
91
- end
92
-
93
- # Custom attribute writer method with validation
94
- # @param [Object] error Value to be assigned
95
- def error=(error)
96
- if error.nil?
97
- fail ArgumentError, 'error cannot be nil'
98
- end
99
-
100
- @error = error
101
- end
102
-
103
- # Checks equality by comparing each attribute.
104
- # @param [Object] Object to be compared
105
- def ==(o)
106
- return true if self.equal?(o)
107
- self.class == o.class &&
108
- error == o.error
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
- [error].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
- return nil unless attributes.is_a?(Hash)
128
- attributes = attributes.transform_keys(&:to_sym)
129
- transformed_hash = {}
130
- openapi_types.each_pair do |key, type|
131
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
- transformed_hash["#{key}"] = nil
133
- elsif type =~ /\AArray<(.*)>/i
134
- # check to ensure the input is an array given that the attribute
135
- # is documented as an array but the input is not
136
- if attributes[attribute_map[key]].is_a?(Array)
137
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
- end
139
- elsif !attributes[attribute_map[key]].nil?
140
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
- end
142
- end
143
- new(transformed_hash)
144
- end
145
-
146
- # Deserializes the data based on type
147
- # @param string type Data type
148
- # @param string value Value to be deserialized
149
- # @return [Object] Deserialized data
150
- def self._deserialize(type, value)
151
- case type.to_sym
152
- when :Time
153
- Time.parse(value)
154
- when :Date
155
- Date.parse(value)
156
- when :String
157
- value.to_s
158
- when :Integer
159
- value.to_i
160
- when :Float
161
- value.to_f
162
- when :Boolean
163
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
- true
165
- else
166
- false
167
- end
168
- when :Object
169
- # generic object (usually a Hash), return directly
170
- value
171
- when /\AArray<(?<inner_type>.+)>\z/
172
- inner_type = Regexp.last_match[:inner_type]
173
- value.map { |v| _deserialize(inner_type, v) }
174
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
- k_type = Regexp.last_match[:k_type]
176
- v_type = Regexp.last_match[:v_type]
177
- {}.tap do |hash|
178
- value.each do |k, v|
179
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
- end
181
- end
182
- else # model
183
- # models (e.g. Pet) or oneOf
184
- klass = TogglrClient.const_get(type)
185
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
- end
187
- end
188
-
189
- # Returns the string representation of the object
190
- # @return [String] String presentation of the object
191
- def to_s
192
- to_hash.to_s
193
- end
194
-
195
- # to_body is an alias to to_hash (backward compatibility)
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_body
198
- to_hash
199
- end
200
-
201
- # Returns the object in the form of hash
202
- # @return [Hash] Returns the object in the form of hash
203
- def to_hash
204
- hash = {}
205
- self.class.attribute_map.each_pair do |attr, param|
206
- value = self.send(attr)
207
- if value.nil?
208
- is_nullable = self.class.openapi_nullable.include?(attr)
209
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
- end
211
-
212
- hash[param] = _to_hash(value)
213
- end
214
- hash
215
- end
216
-
217
- # Outputs non-array value in the form of hash
218
- # For object, use to_hash. Otherwise, just return the value
219
- # @param [Object] value Any valid value
220
- # @return [Hash] Returns the value in the form of hash
221
- def _to_hash(value)
222
- if value.is_a?(Array)
223
- value.compact.map { |v| _to_hash(v) }
224
- elsif value.is_a?(Hash)
225
- {}.tap do |hash|
226
- value.each { |k, v| hash[k] = _to_hash(v) }
227
- end
228
- elsif value.respond_to? :to_hash
229
- value.to_hash
230
- else
231
- value
232
- end
233
- end
234
-
235
- end
236
-
237
- end