ultracart_api 3.3.2 → 3.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +61 -4
  3. data/docs/ConfigurationApi.md +756 -0
  4. data/docs/DelayAutoOrdersResponse.md +12 -0
  5. data/docs/IntegrationLogApi.md +51 -0
  6. data/docs/IntegrationLogSummary.md +16 -0
  7. data/docs/IntegrationLogSummaryQueryRequest.md +9 -0
  8. data/docs/IntegrationLogSummaryQueryResponse.md +12 -0
  9. data/docs/OrderChannelPartner.md +1 -0
  10. data/docs/PaymentsConfiguration.md +23 -0
  11. data/docs/PaymentsConfigurationAffirm.md +15 -0
  12. data/docs/PaymentsConfigurationAmazon.md +15 -0
  13. data/docs/PaymentsConfigurationCOD.md +13 -0
  14. data/docs/PaymentsConfigurationCash.md +9 -0
  15. data/docs/PaymentsConfigurationCheck.md +25 -0
  16. data/docs/PaymentsConfigurationCreditCard.md +16 -0
  17. data/docs/PaymentsConfigurationLoanHero.md +12 -0
  18. data/docs/PaymentsConfigurationPayPal.md +36 -0
  19. data/docs/PaymentsConfigurationPurchaseOrder.md +11 -0
  20. data/docs/PaymentsConfigurationQuoteRequest.md +10 -0
  21. data/docs/PaymentsConfigurationResponse.md +12 -0
  22. data/docs/PaymentsConfigurationRestrictions.md +19 -0
  23. data/docs/PaymentsConfigurationSezzle.md +15 -0
  24. data/docs/PaymentsConfigurationWePay.md +35 -0
  25. data/docs/PaymentsConfigurationWireTransfer.md +18 -0
  26. data/docs/PaymentsThemeTransactionType.md +10 -0
  27. data/docs/PaymentsWepayEnroll.md +22 -0
  28. data/docs/RotatingTransactionGateway.md +50 -0
  29. data/docs/RotatingTransactionGatewayResponse.md +12 -0
  30. data/docs/RotatingTransactionGatewaysResponse.md +12 -0
  31. data/docs/RtgCurrency.md +10 -0
  32. data/docs/RtgDayOfMonthRestriction.md +9 -0
  33. data/docs/RtgDayOfWeekRestriction.md +10 -0
  34. data/docs/RtgSummaryGateway.md +24 -0
  35. data/docs/RtgSummaryResponse.md +14 -0
  36. data/docs/RtgThemeRestriction.md +10 -0
  37. data/docs/StripeConnectResponse.md +12 -0
  38. data/docs/TransactionGateway.md +71 -0
  39. data/docs/TransactionGatewaysRequest.md +10 -0
  40. data/docs/TransactionGatewaysResponse.md +12 -0
  41. data/lib/ultracart_api.rb +36 -0
  42. data/lib/ultracart_api/api/configuration_api.rb +843 -0
  43. data/lib/ultracart_api/api/integration_log_api.rb +55 -0
  44. data/lib/ultracart_api/models/delay_auto_orders_response.rb +221 -0
  45. data/lib/ultracart_api/models/integration_log_summary.rb +256 -0
  46. data/lib/ultracart_api/models/integration_log_summary_query_request.rb +195 -0
  47. data/lib/ultracart_api/models/integration_log_summary_query_response.rb +223 -0
  48. data/lib/ultracart_api/models/order_channel_partner.rb +11 -1
  49. data/lib/ultracart_api/models/payments_configuration.rb +319 -0
  50. data/lib/ultracart_api/models/payments_configuration_affirm.rb +247 -0
  51. data/lib/ultracart_api/models/payments_configuration_amazon.rb +247 -0
  52. data/lib/ultracart_api/models/payments_configuration_cash.rb +193 -0
  53. data/lib/ultracart_api/models/payments_configuration_check.rb +337 -0
  54. data/lib/ultracart_api/models/payments_configuration_cod.rb +229 -0
  55. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +256 -0
  56. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +220 -0
  57. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +436 -0
  58. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +211 -0
  59. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +202 -0
  60. data/lib/ultracart_api/models/payments_configuration_response.rb +221 -0
  61. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +283 -0
  62. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +247 -0
  63. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +427 -0
  64. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +274 -0
  65. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +239 -0
  66. data/lib/ultracart_api/models/payments_wepay_enroll.rb +310 -0
  67. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +665 -0
  68. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +221 -0
  69. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +223 -0
  70. data/lib/ultracart_api/models/rtg_currency.rb +205 -0
  71. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +195 -0
  72. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +205 -0
  73. data/lib/ultracart_api/models/rtg_summary_gateway.rb +329 -0
  74. data/lib/ultracart_api/models/rtg_summary_response.rb +240 -0
  75. data/lib/ultracart_api/models/rtg_theme_restriction.rb +239 -0
  76. data/lib/ultracart_api/models/stripe_connect_response.rb +221 -0
  77. data/lib/ultracart_api/models/transaction_gateway.rb +823 -0
  78. data/lib/ultracart_api/models/transaction_gateways_request.rb +242 -0
  79. data/lib/ultracart_api/models/transaction_gateways_response.rb +223 -0
  80. data/lib/ultracart_api/version.rb +1 -1
  81. metadata +74 -2
@@ -160,6 +160,61 @@ module UltracartClient
160
160
  end
161
161
  return data, status_code, headers
162
162
  end
163
+ # Retrieve integration log summaries
164
+ # Retrieves a set of integration log summaries from the account based on a query object.
165
+ # @param integration_log_summaries_query Integration log summaries query
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [IntegrationLogSummaryQueryResponse]
168
+ def get_integration_log_summaries_query(integration_log_summaries_query, opts = {})
169
+ data, _status_code, _headers = get_integration_log_summaries_query_with_http_info(integration_log_summaries_query, opts)
170
+ data
171
+ end
172
+
173
+ # Retrieve integration log summaries
174
+ # Retrieves a set of integration log summaries from the account based on a query object.
175
+ # @param integration_log_summaries_query Integration log summaries query
176
+ # @param [Hash] opts the optional parameters
177
+ # @return [Array<(IntegrationLogSummaryQueryResponse, Fixnum, Hash)>] IntegrationLogSummaryQueryResponse data, response status code and response headers
178
+ def get_integration_log_summaries_query_with_http_info(integration_log_summaries_query, opts = {})
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug 'Calling API: IntegrationLogApi.get_integration_log_summaries_query ...'
181
+ end
182
+ # verify the required parameter 'integration_log_summaries_query' is set
183
+ if @api_client.config.client_side_validation && integration_log_summaries_query.nil?
184
+ fail ArgumentError, "Missing the required parameter 'integration_log_summaries_query' when calling IntegrationLogApi.get_integration_log_summaries_query"
185
+ end
186
+ # resource path
187
+ local_var_path = '/integration_log/summary/query'
188
+
189
+ # query parameters
190
+ query_params = {}
191
+
192
+ # header parameters
193
+ header_params = {}
194
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
197
+ # HTTP header 'Content-Type'
198
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
199
+
200
+ # form parameters
201
+ form_params = {}
202
+
203
+ # http body (model)
204
+ post_body = @api_client.object_to_http_body(integration_log_summaries_query)
205
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
206
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => 'IntegrationLogSummaryQueryResponse')
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug "API called: IntegrationLogApi#get_integration_log_summaries_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
215
+ end
216
+ return data, status_code, headers
217
+ end
163
218
  # Retrieve integration logs
164
219
  # Retrieves a set of integration logs from the account based on a query object.
165
220
  # @param integration_log_query Integration log query
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class DelayAutoOrdersResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :message
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'error' => :'error',
32
+ :'message' => :'message',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'error' => :'Error',
43
+ :'message' => :'String',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'error')
59
+ self.error = attributes[:'error']
60
+ end
61
+
62
+ if attributes.has_key?(:'message')
63
+ self.message = attributes[:'message']
64
+ end
65
+
66
+ if attributes.has_key?(:'metadata')
67
+ self.metadata = attributes[:'metadata']
68
+ end
69
+
70
+ if attributes.has_key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.has_key?(:'warning')
75
+ self.warning = attributes[:'warning']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ error == o.error &&
98
+ message == o.message &&
99
+ metadata == o.metadata &&
100
+ success == o.success &&
101
+ warning == o.warning
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [error, message, metadata, success, warning].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = UltracartClient.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+ end
@@ -0,0 +1,256 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class IntegrationLogSummary
17
+ attr_accessor :critical
18
+
19
+ attr_accessor :error
20
+
21
+ attr_accessor :events
22
+
23
+ attr_accessor :log_type
24
+
25
+ attr_accessor :logger_id
26
+
27
+ attr_accessor :logger_name
28
+
29
+ attr_accessor :success
30
+
31
+ attr_accessor :view_url
32
+
33
+ attr_accessor :warning
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'critical' => :'critical',
39
+ :'error' => :'error',
40
+ :'events' => :'events',
41
+ :'log_type' => :'log_type',
42
+ :'logger_id' => :'logger_id',
43
+ :'logger_name' => :'logger_name',
44
+ :'success' => :'success',
45
+ :'view_url' => :'view_url',
46
+ :'warning' => :'warning'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'critical' => :'Integer',
54
+ :'error' => :'Integer',
55
+ :'events' => :'Integer',
56
+ :'log_type' => :'String',
57
+ :'logger_id' => :'String',
58
+ :'logger_name' => :'String',
59
+ :'success' => :'Integer',
60
+ :'view_url' => :'String',
61
+ :'warning' => :'Integer'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'critical')
74
+ self.critical = attributes[:'critical']
75
+ end
76
+
77
+ if attributes.has_key?(:'error')
78
+ self.error = attributes[:'error']
79
+ end
80
+
81
+ if attributes.has_key?(:'events')
82
+ self.events = attributes[:'events']
83
+ end
84
+
85
+ if attributes.has_key?(:'log_type')
86
+ self.log_type = attributes[:'log_type']
87
+ end
88
+
89
+ if attributes.has_key?(:'logger_id')
90
+ self.logger_id = attributes[:'logger_id']
91
+ end
92
+
93
+ if attributes.has_key?(:'logger_name')
94
+ self.logger_name = attributes[:'logger_name']
95
+ end
96
+
97
+ if attributes.has_key?(:'success')
98
+ self.success = attributes[:'success']
99
+ end
100
+
101
+ if attributes.has_key?(:'view_url')
102
+ self.view_url = attributes[:'view_url']
103
+ end
104
+
105
+ if attributes.has_key?(:'warning')
106
+ self.warning = attributes[:'warning']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ critical == o.critical &&
129
+ error == o.error &&
130
+ events == o.events &&
131
+ log_type == o.log_type &&
132
+ logger_id == o.logger_id &&
133
+ logger_name == o.logger_name &&
134
+ success == o.success &&
135
+ view_url == o.view_url &&
136
+ warning == o.warning
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Fixnum] Hash code
147
+ def hash
148
+ [critical, error, events, log_type, logger_id, logger_name, success, view_url, warning].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.swagger_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :BOOLEAN
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ temp_model = UltracartClient.const_get(type).new
209
+ temp_model.build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ next if value.nil?
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+ end