mx-platform-ruby 0.1.1 → 0.2.0

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 (260) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -2
  3. data/Gemfile.lock +84 -0
  4. data/README.md +236 -33
  5. data/Rakefile +8 -9
  6. data/lib/mx-platform-ruby.rb +126 -35
  7. data/lib/mx-platform-ruby/api/mx_platform_api.rb +4917 -0
  8. data/lib/mx-platform-ruby/api_client.rb +395 -0
  9. data/lib/mx-platform-ruby/api_error.rb +57 -0
  10. data/lib/mx-platform-ruby/configuration.rb +276 -0
  11. data/lib/mx-platform-ruby/models/account.rb +569 -0
  12. data/lib/mx-platform-ruby/models/account_number.rb +281 -0
  13. data/lib/mx-platform-ruby/models/account_numbers_response_body.rb +229 -0
  14. data/lib/mx-platform-ruby/models/account_owner.rb +317 -0
  15. data/lib/mx-platform-ruby/models/account_owners_response_body.rb +229 -0
  16. data/lib/mx-platform-ruby/models/account_response_body.rb +218 -0
  17. data/lib/mx-platform-ruby/models/account_update_request.rb +218 -0
  18. data/lib/mx-platform-ruby/models/account_update_request_body.rb +218 -0
  19. data/lib/mx-platform-ruby/models/accounts_response_body.rb +229 -0
  20. data/lib/mx-platform-ruby/models/categories_response_body.rb +229 -0
  21. data/lib/mx-platform-ruby/models/category.rb +281 -0
  22. data/lib/mx-platform-ruby/models/category_create_request.rb +241 -0
  23. data/lib/mx-platform-ruby/models/category_create_request_body.rb +218 -0
  24. data/lib/mx-platform-ruby/models/category_response_body.rb +218 -0
  25. data/lib/mx-platform-ruby/models/category_update_request.rb +227 -0
  26. data/lib/mx-platform-ruby/models/category_update_request_body.rb +218 -0
  27. data/lib/mx-platform-ruby/models/challenge.rb +276 -0
  28. data/lib/mx-platform-ruby/models/challenge_image_options.rb +236 -0
  29. data/lib/mx-platform-ruby/models/challenge_options.rb +227 -0
  30. data/lib/mx-platform-ruby/models/challenges_response_body.rb +229 -0
  31. data/lib/mx-platform-ruby/models/connect_widget.rb +227 -0
  32. data/lib/mx-platform-ruby/models/connect_widget_request.rb +308 -0
  33. data/lib/mx-platform-ruby/models/connect_widget_request_body.rb +218 -0
  34. data/lib/mx-platform-ruby/models/connect_widget_response_body.rb +218 -0
  35. data/lib/mx-platform-ruby/models/credential.rb +254 -0
  36. data/lib/mx-platform-ruby/models/credential_request.rb +227 -0
  37. data/lib/mx-platform-ruby/models/credentials_response_body.rb +229 -0
  38. data/lib/mx-platform-ruby/models/enhance_transaction.rb +353 -0
  39. data/lib/mx-platform-ruby/models/enhance_transactions_request.rb +264 -0
  40. data/lib/mx-platform-ruby/models/enhance_transactions_request_body.rb +220 -0
  41. data/lib/mx-platform-ruby/models/enhance_transactions_response_body.rb +220 -0
  42. data/lib/mx-platform-ruby/models/holding.rb +371 -0
  43. data/lib/mx-platform-ruby/models/holding_response_body.rb +218 -0
  44. data/lib/mx-platform-ruby/models/holdings_response_body.rb +229 -0
  45. data/lib/mx-platform-ruby/models/inline_response200.rb +218 -0
  46. data/lib/mx-platform-ruby/models/institution.rb +299 -0
  47. data/lib/mx-platform-ruby/models/institution_response_body.rb +218 -0
  48. data/lib/mx-platform-ruby/models/institutions_response_body.rb +229 -0
  49. data/lib/mx-platform-ruby/models/member.rb +317 -0
  50. data/lib/mx-platform-ruby/models/member_create_request.rb +284 -0
  51. data/lib/mx-platform-ruby/models/member_create_request_body.rb +236 -0
  52. data/lib/mx-platform-ruby/models/member_response_body.rb +218 -0
  53. data/lib/mx-platform-ruby/models/member_resume_request.rb +220 -0
  54. data/lib/mx-platform-ruby/models/member_resume_request_body.rb +218 -0
  55. data/lib/mx-platform-ruby/models/member_status.rb +292 -0
  56. data/lib/mx-platform-ruby/models/member_status_response_body.rb +218 -0
  57. data/lib/mx-platform-ruby/models/member_update_request.rb +256 -0
  58. data/lib/mx-platform-ruby/models/member_update_request_body.rb +218 -0
  59. data/lib/mx-platform-ruby/models/members_response_body.rb +229 -0
  60. data/lib/mx-platform-ruby/models/merchant.rb +263 -0
  61. data/lib/mx-platform-ruby/models/merchant_response_body.rb +218 -0
  62. data/lib/mx-platform-ruby/models/merchants_response_body.rb +229 -0
  63. data/lib/mx-platform-ruby/models/o_auth_window.rb +227 -0
  64. data/lib/mx-platform-ruby/models/o_auth_window_response_body.rb +218 -0
  65. data/lib/mx-platform-ruby/models/pagination.rb +245 -0
  66. data/lib/mx-platform-ruby/models/statement.rb +281 -0
  67. data/lib/mx-platform-ruby/models/statement_response_body.rb +218 -0
  68. data/lib/mx-platform-ruby/models/statements_response_body.rb +229 -0
  69. data/lib/mx-platform-ruby/models/tag.rb +236 -0
  70. data/lib/mx-platform-ruby/models/tag_create_request.rb +223 -0
  71. data/lib/mx-platform-ruby/models/tag_create_request_body.rb +218 -0
  72. data/lib/mx-platform-ruby/models/tag_response_body.rb +218 -0
  73. data/lib/mx-platform-ruby/models/tag_update_request.rb +223 -0
  74. data/lib/mx-platform-ruby/models/tag_update_request_body.rb +218 -0
  75. data/lib/mx-platform-ruby/models/tagging.rb +254 -0
  76. data/lib/mx-platform-ruby/models/tagging_create_request.rb +237 -0
  77. data/lib/mx-platform-ruby/models/tagging_create_request_body.rb +218 -0
  78. data/lib/mx-platform-ruby/models/tagging_response_body.rb +218 -0
  79. data/lib/mx-platform-ruby/models/tagging_update_request.rb +223 -0
  80. data/lib/mx-platform-ruby/models/tagging_update_request_body.rb +218 -0
  81. data/lib/mx-platform-ruby/models/taggings_response_body.rb +229 -0
  82. data/lib/mx-platform-ruby/models/tags_response_body.rb +229 -0
  83. data/lib/mx-platform-ruby/models/transaction.rb +533 -0
  84. data/lib/mx-platform-ruby/models/transaction_response_body.rb +218 -0
  85. data/lib/mx-platform-ruby/models/transaction_rule.rb +272 -0
  86. data/lib/mx-platform-ruby/models/transaction_rule_create_request.rb +246 -0
  87. data/lib/mx-platform-ruby/models/transaction_rule_create_request_body.rb +218 -0
  88. data/lib/mx-platform-ruby/models/transaction_rule_response_body.rb +218 -0
  89. data/lib/mx-platform-ruby/models/transaction_rule_update_request.rb +236 -0
  90. data/lib/mx-platform-ruby/models/transaction_rule_update_request_body.rb +218 -0
  91. data/lib/mx-platform-ruby/models/transaction_rules_response_body.rb +229 -0
  92. data/lib/mx-platform-ruby/models/transaction_update_request.rb +223 -0
  93. data/lib/mx-platform-ruby/models/transaction_update_request_body.rb +218 -0
  94. data/lib/mx-platform-ruby/models/transactions_response_body.rb +229 -0
  95. data/lib/mx-platform-ruby/models/user.rb +254 -0
  96. data/lib/mx-platform-ruby/models/user_create_request.rb +245 -0
  97. data/lib/mx-platform-ruby/models/user_create_request_body.rb +218 -0
  98. data/lib/mx-platform-ruby/models/user_response_body.rb +218 -0
  99. data/lib/mx-platform-ruby/models/user_update_request.rb +245 -0
  100. data/lib/mx-platform-ruby/models/user_update_request_body.rb +218 -0
  101. data/lib/mx-platform-ruby/models/users_response_body.rb +229 -0
  102. data/lib/mx-platform-ruby/models/widget.rb +236 -0
  103. data/lib/mx-platform-ruby/models/widget_request.rb +331 -0
  104. data/lib/mx-platform-ruby/models/widget_request_body.rb +218 -0
  105. data/lib/mx-platform-ruby/models/widget_response_body.rb +218 -0
  106. data/lib/mx-platform-ruby/version.rb +13 -3
  107. data/mx-platform-ruby.gemspec +34 -27
  108. data/openapi/mx_platform_ruby.yml +11 -0
  109. data/spec/api/mx_platform_api_spec.rb +979 -0
  110. data/spec/api_client_spec.rb +188 -0
  111. data/spec/configuration_spec.rb +42 -0
  112. data/spec/models/account_number_spec.rb +76 -0
  113. data/spec/models/account_numbers_response_body_spec.rb +40 -0
  114. data/spec/models/account_owner_spec.rb +100 -0
  115. data/spec/models/account_owners_response_body_spec.rb +40 -0
  116. data/spec/models/account_response_body_spec.rb +34 -0
  117. data/spec/models/account_spec.rb +268 -0
  118. data/spec/models/account_update_request_body_spec.rb +34 -0
  119. data/spec/models/account_update_request_spec.rb +34 -0
  120. data/spec/models/accounts_response_body_spec.rb +40 -0
  121. data/spec/models/categories_response_body_spec.rb +40 -0
  122. data/spec/models/category_create_request_body_spec.rb +34 -0
  123. data/spec/models/category_create_request_spec.rb +46 -0
  124. data/spec/models/category_response_body_spec.rb +34 -0
  125. data/spec/models/category_spec.rb +76 -0
  126. data/spec/models/category_update_request_body_spec.rb +34 -0
  127. data/spec/models/category_update_request_spec.rb +40 -0
  128. data/spec/models/challenge_image_options_spec.rb +46 -0
  129. data/spec/models/challenge_options_spec.rb +40 -0
  130. data/spec/models/challenge_spec.rb +70 -0
  131. data/spec/models/challenges_response_body_spec.rb +40 -0
  132. data/spec/models/connect_widget_request_body_spec.rb +34 -0
  133. data/spec/models/connect_widget_request_spec.rb +94 -0
  134. data/spec/models/connect_widget_response_body_spec.rb +34 -0
  135. data/spec/models/connect_widget_spec.rb +40 -0
  136. data/spec/models/credential_request_spec.rb +40 -0
  137. data/spec/models/credential_spec.rb +58 -0
  138. data/spec/models/credentials_response_body_spec.rb +40 -0
  139. data/spec/models/enhance_transaction_spec.rb +124 -0
  140. data/spec/models/enhance_transactions_request_body_spec.rb +34 -0
  141. data/spec/models/enhance_transactions_request_spec.rb +58 -0
  142. data/spec/models/enhance_transactions_response_body_spec.rb +34 -0
  143. data/spec/models/holding_response_body_spec.rb +34 -0
  144. data/spec/models/holding_spec.rb +136 -0
  145. data/spec/models/holdings_response_body_spec.rb +40 -0
  146. data/spec/models/inline_response200_spec.rb +34 -0
  147. data/spec/models/institution_response_body_spec.rb +34 -0
  148. data/spec/models/institution_spec.rb +88 -0
  149. data/spec/models/institutions_response_body_spec.rb +40 -0
  150. data/spec/models/member_create_request_body_spec.rb +46 -0
  151. data/spec/models/member_create_request_spec.rb +70 -0
  152. data/spec/models/member_response_body_spec.rb +34 -0
  153. data/spec/models/member_resume_request_body_spec.rb +34 -0
  154. data/spec/models/member_resume_request_spec.rb +34 -0
  155. data/spec/models/member_spec.rb +100 -0
  156. data/spec/models/member_status_response_body_spec.rb +34 -0
  157. data/spec/models/member_status_spec.rb +82 -0
  158. data/spec/models/member_update_request_body_spec.rb +34 -0
  159. data/spec/models/member_update_request_spec.rb +58 -0
  160. data/spec/models/members_response_body_spec.rb +40 -0
  161. data/spec/models/merchant_response_body_spec.rb +34 -0
  162. data/spec/models/merchant_spec.rb +64 -0
  163. data/spec/models/merchants_response_body_spec.rb +40 -0
  164. data/spec/models/o_auth_window_response_body_spec.rb +34 -0
  165. data/spec/models/o_auth_window_spec.rb +40 -0
  166. data/spec/models/pagination_spec.rb +52 -0
  167. data/spec/models/statement_response_body_spec.rb +34 -0
  168. data/spec/models/statement_spec.rb +76 -0
  169. data/spec/models/statements_response_body_spec.rb +40 -0
  170. data/spec/models/tag_create_request_body_spec.rb +34 -0
  171. data/spec/models/tag_create_request_spec.rb +34 -0
  172. data/spec/models/tag_response_body_spec.rb +34 -0
  173. data/spec/models/tag_spec.rb +46 -0
  174. data/spec/models/tag_update_request_body_spec.rb +34 -0
  175. data/spec/models/tag_update_request_spec.rb +34 -0
  176. data/spec/models/tagging_create_request_body_spec.rb +34 -0
  177. data/spec/models/tagging_create_request_spec.rb +40 -0
  178. data/spec/models/tagging_response_body_spec.rb +34 -0
  179. data/spec/models/tagging_spec.rb +58 -0
  180. data/spec/models/tagging_update_request_body_spec.rb +34 -0
  181. data/spec/models/tagging_update_request_spec.rb +34 -0
  182. data/spec/models/taggings_response_body_spec.rb +40 -0
  183. data/spec/models/tags_response_body_spec.rb +40 -0
  184. data/spec/models/transaction_response_body_spec.rb +34 -0
  185. data/spec/models/transaction_rule_create_request_body_spec.rb +34 -0
  186. data/spec/models/transaction_rule_create_request_spec.rb +46 -0
  187. data/spec/models/transaction_rule_response_body_spec.rb +34 -0
  188. data/spec/models/transaction_rule_spec.rb +70 -0
  189. data/spec/models/transaction_rule_update_request_body_spec.rb +34 -0
  190. data/spec/models/transaction_rule_update_request_spec.rb +46 -0
  191. data/spec/models/transaction_rules_response_body_spec.rb +40 -0
  192. data/spec/models/transaction_spec.rb +244 -0
  193. data/spec/models/transaction_update_request_body_spec.rb +34 -0
  194. data/spec/models/transaction_update_request_spec.rb +34 -0
  195. data/spec/models/transactions_response_body_spec.rb +40 -0
  196. data/spec/models/user_create_request_body_spec.rb +34 -0
  197. data/spec/models/user_create_request_spec.rb +52 -0
  198. data/spec/models/user_response_body_spec.rb +34 -0
  199. data/spec/models/user_spec.rb +58 -0
  200. data/spec/models/user_update_request_body_spec.rb +34 -0
  201. data/spec/models/user_update_request_spec.rb +52 -0
  202. data/spec/models/users_response_body_spec.rb +40 -0
  203. data/spec/models/widget_request_body_spec.rb +34 -0
  204. data/spec/models/widget_request_spec.rb +106 -0
  205. data/spec/models/widget_response_body_spec.rb +34 -0
  206. data/spec/models/widget_spec.rb +46 -0
  207. data/spec/spec_helper.rb +100 -13
  208. metadata +317 -144
  209. data/.github/workflows/test.yml +0 -20
  210. data/.gitignore +0 -13
  211. data/.rubocop.yml +0 -44
  212. data/lib/mx-platform-ruby/account.rb +0 -107
  213. data/lib/mx-platform-ruby/account_number.rb +0 -57
  214. data/lib/mx-platform-ruby/account_owner.rb +0 -42
  215. data/lib/mx-platform-ruby/category.rb +0 -127
  216. data/lib/mx-platform-ruby/challenge.rb +0 -37
  217. data/lib/mx-platform-ruby/client.rb +0 -59
  218. data/lib/mx-platform-ruby/connect_widget.rb +0 -43
  219. data/lib/mx-platform-ruby/credential.rb +0 -54
  220. data/lib/mx-platform-ruby/enhanced_transaction.rb +0 -44
  221. data/lib/mx-platform-ruby/error.rb +0 -6
  222. data/lib/mx-platform-ruby/holding.rb +0 -87
  223. data/lib/mx-platform-ruby/institution.rb +0 -78
  224. data/lib/mx-platform-ruby/member.rb +0 -242
  225. data/lib/mx-platform-ruby/member_status.rb +0 -35
  226. data/lib/mx-platform-ruby/merchant.rb +0 -52
  227. data/lib/mx-platform-ruby/oauth_window.rb +0 -32
  228. data/lib/mx-platform-ruby/pageable.rb +0 -29
  229. data/lib/mx-platform-ruby/statement.rb +0 -70
  230. data/lib/mx-platform-ruby/tag.rb +0 -104
  231. data/lib/mx-platform-ruby/tagging.rb +0 -107
  232. data/lib/mx-platform-ruby/transaction.rb +0 -162
  233. data/lib/mx-platform-ruby/transaction_rule.rb +0 -112
  234. data/lib/mx-platform-ruby/user.rb +0 -112
  235. data/lib/mx-platform-ruby/widget.rb +0 -49
  236. data/spec/lib/mx-platform-ruby/account_number_spec.rb +0 -100
  237. data/spec/lib/mx-platform-ruby/account_owner_spec.rb +0 -71
  238. data/spec/lib/mx-platform-ruby/account_spec.rb +0 -267
  239. data/spec/lib/mx-platform-ruby/category_spec.rb +0 -244
  240. data/spec/lib/mx-platform-ruby/challenge_spec.rb +0 -72
  241. data/spec/lib/mx-platform-ruby/client_spec.rb +0 -101
  242. data/spec/lib/mx-platform-ruby/connect_widget_spec.rb +0 -66
  243. data/spec/lib/mx-platform-ruby/credential_spec.rb +0 -90
  244. data/spec/lib/mx-platform-ruby/enhanced_transaction_spec.rb +0 -89
  245. data/spec/lib/mx-platform-ruby/holding_spec.rb +0 -178
  246. data/spec/lib/mx-platform-ruby/institution_spec.rb +0 -141
  247. data/spec/lib/mx-platform-ruby/member_spec.rb +0 -557
  248. data/spec/lib/mx-platform-ruby/member_status_spec.rb +0 -76
  249. data/spec/lib/mx-platform-ruby/merchant_spec.rb +0 -89
  250. data/spec/lib/mx-platform-ruby/oauth_window_spec.rb +0 -47
  251. data/spec/lib/mx-platform-ruby/pageable_spec.rb +0 -75
  252. data/spec/lib/mx-platform-ruby/statement_spec.rb +0 -130
  253. data/spec/lib/mx-platform-ruby/tag_spec.rb +0 -179
  254. data/spec/lib/mx-platform-ruby/tagging_spec.rb +0 -191
  255. data/spec/lib/mx-platform-ruby/transaction_rule_spec.rb +0 -207
  256. data/spec/lib/mx-platform-ruby/transaction_spec.rb +0 -449
  257. data/spec/lib/mx-platform-ruby/user_spec.rb +0 -196
  258. data/spec/lib/mx-platform-ruby/widget_spec.rb +0 -76
  259. data/spec/lib/mx-platform-ruby_spec.rb +0 -15
  260. data/spec/sample.pdf +0 -0
@@ -0,0 +1,276 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ module MxPlatformRuby
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
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
66
+ # details will be logged with `logger.debug` (see the `logger` attribute).
67
+ # Default to false.
68
+ #
69
+ # @return [true, false]
70
+ attr_accessor :debugging
71
+
72
+ # Defines the logger used for debugging.
73
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
74
+ #
75
+ # @return [#debug]
76
+ attr_accessor :logger
77
+
78
+ # Defines the temporary folder to store downloaded files
79
+ # (for API endpoints that have file response).
80
+ # Default to use `Tempfile`.
81
+ #
82
+ # @return [String]
83
+ attr_accessor :temp_folder_path
84
+
85
+ # The time limit for HTTP request in seconds.
86
+ # Default to 0 (never times out).
87
+ attr_accessor :timeout
88
+
89
+ # Set this to false to skip client side validation in the operation.
90
+ # Default to true.
91
+ # @return [true, false]
92
+ attr_accessor :client_side_validation
93
+
94
+ ### TLS/SSL setting
95
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
96
+ # Default to true.
97
+ #
98
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
99
+ #
100
+ # @return [true, false]
101
+ attr_accessor :ssl_verify
102
+
103
+ ### TLS/SSL setting
104
+ # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
105
+ #
106
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
107
+ #
108
+ attr_accessor :ssl_verify_mode
109
+
110
+ ### TLS/SSL setting
111
+ # Set this to customize the certificate file to verify the peer.
112
+ #
113
+ # @return [String] the path to the certificate file
114
+ attr_accessor :ssl_ca_file
115
+
116
+ ### TLS/SSL setting
117
+ # Client certificate file (for client certificate)
118
+ attr_accessor :ssl_client_cert
119
+
120
+ ### TLS/SSL setting
121
+ # Client private key file (for client certificate)
122
+ attr_accessor :ssl_client_key
123
+
124
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
125
+ # Default to nil.
126
+ #
127
+ # @see The params_encoding option of Ethon. Related source code:
128
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
129
+ attr_accessor :params_encoding
130
+
131
+ attr_accessor :inject_format
132
+
133
+ attr_accessor :force_ending_format
134
+
135
+ def initialize
136
+ @scheme = 'https'
137
+ @host = 'api.mx.com'
138
+ @base_path = ''
139
+ @server_index = 0
140
+ @server_operation_index = {}
141
+ @server_variables = {}
142
+ @server_operation_variables = {}
143
+ @api_key = {}
144
+ @api_key_prefix = {}
145
+ @timeout = 0
146
+ @client_side_validation = true
147
+ @ssl_verify = true
148
+ @ssl_verify_mode = nil
149
+ @ssl_ca_file = nil
150
+ @ssl_client_cert = nil
151
+ @ssl_client_key = nil
152
+ @debugging = false
153
+ @inject_format = false
154
+ @force_ending_format = false
155
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
156
+
157
+ yield(self) if block_given?
158
+ end
159
+
160
+ # The default Configuration object.
161
+ def self.default
162
+ @@default ||= Configuration.new
163
+ end
164
+
165
+ def configure
166
+ yield(self) if block_given?
167
+ end
168
+
169
+ def scheme=(scheme)
170
+ # remove :// from scheme
171
+ @scheme = scheme.sub(/:\/\//, '')
172
+ end
173
+
174
+ def host=(host)
175
+ # remove http(s):// and anything after a slash
176
+ @host = host.sub(/https?:\/\//, '').split('/').first
177
+ end
178
+
179
+ def base_path=(base_path)
180
+ # Add leading and trailing slashes to base_path
181
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
182
+ @base_path = '' if @base_path == '/'
183
+ end
184
+
185
+ # Returns base URL for specified operation based on server settings
186
+ def base_url(operation = nil)
187
+ index = server_operation_index.fetch(operation, server_index)
188
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
189
+
190
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
191
+ end
192
+
193
+ # Gets API key (with prefix if set).
194
+ # @param [String] param_name the parameter name of API key auth
195
+ def api_key_with_prefix(param_name, param_alias = nil)
196
+ key = @api_key[param_name]
197
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
198
+ if @api_key_prefix[param_name]
199
+ "#{@api_key_prefix[param_name]} #{key}"
200
+ else
201
+ key
202
+ end
203
+ end
204
+
205
+ # Gets Basic Auth token string
206
+ def basic_auth_token
207
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
208
+ end
209
+
210
+ # Returns Auth Settings hash for api client.
211
+ def auth_settings
212
+ {
213
+ 'basicAuth' =>
214
+ {
215
+ type: 'basic',
216
+ in: 'header',
217
+ key: 'Authorization',
218
+ value: basic_auth_token
219
+ },
220
+ }
221
+ end
222
+
223
+ # Returns an array of Server setting
224
+ def server_settings
225
+ [
226
+ {
227
+ url: "https://api.mx.com",
228
+ description: "No description provided",
229
+ },
230
+ {
231
+ url: "https://int-api.mx.com",
232
+ description: "No description provided",
233
+ }
234
+ ]
235
+ end
236
+
237
+ def operation_server_settings
238
+ {
239
+ }
240
+ end
241
+
242
+ # Returns URL based on server settings
243
+ #
244
+ # @param index array index of the server settings
245
+ # @param variables hash of variable and the corresponding value
246
+ def server_url(index, variables = {}, servers = nil)
247
+ servers = server_settings if servers == nil
248
+
249
+ # check array index out of bound
250
+ if (index < 0 || index >= servers.size)
251
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
252
+ end
253
+
254
+ server = servers[index]
255
+ url = server[:url]
256
+
257
+ return url unless server.key? :variables
258
+
259
+ # go through variable and assign a value
260
+ server[:variables].each do |name, variable|
261
+ if variables.key?(name)
262
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
263
+ url.gsub! "{" + name.to_s + "}", variables[name]
264
+ else
265
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
266
+ end
267
+ else
268
+ # use default value
269
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
270
+ end
271
+ end
272
+
273
+ url
274
+ end
275
+ end
276
+ end
@@ -0,0 +1,569 @@
1
+ =begin
2
+ #MX Platform API
3
+
4
+ #The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MxPlatformRuby
17
+ class Account
18
+ attr_accessor :account_number
19
+
20
+ attr_accessor :apr
21
+
22
+ attr_accessor :apy
23
+
24
+ attr_accessor :available_balance
25
+
26
+ attr_accessor :available_credit
27
+
28
+ attr_accessor :balance
29
+
30
+ attr_accessor :cash_balance
31
+
32
+ attr_accessor :cash_surrender_value
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :credit_limit
37
+
38
+ attr_accessor :currency_code
39
+
40
+ attr_accessor :day_payment_is_due
41
+
42
+ attr_accessor :death_benefit
43
+
44
+ attr_accessor :guid
45
+
46
+ attr_accessor :holdings_value
47
+
48
+ attr_accessor :id
49
+
50
+ attr_accessor :institution_code
51
+
52
+ attr_accessor :insured_name
53
+
54
+ attr_accessor :interest_rate
55
+
56
+ attr_accessor :is_closed
57
+
58
+ attr_accessor :is_hidden
59
+
60
+ attr_accessor :last_payment
61
+
62
+ attr_accessor :last_payment_at
63
+
64
+ attr_accessor :loan_amount
65
+
66
+ attr_accessor :matures_on
67
+
68
+ attr_accessor :member_guid
69
+
70
+ attr_accessor :minimum_balance
71
+
72
+ attr_accessor :minimum_payment
73
+
74
+ attr_accessor :name
75
+
76
+ attr_accessor :original_balance
77
+
78
+ attr_accessor :pay_out_amount
79
+
80
+ attr_accessor :payment_due_at
81
+
82
+ attr_accessor :payoff_balance
83
+
84
+ attr_accessor :premium_amount
85
+
86
+ attr_accessor :started_on
87
+
88
+ attr_accessor :subtype
89
+
90
+ attr_accessor :total_account_value
91
+
92
+ attr_accessor :type
93
+
94
+ attr_accessor :updated_at
95
+
96
+ attr_accessor :user_guid
97
+
98
+ # Attribute mapping from ruby-style variable name to JSON key.
99
+ def self.attribute_map
100
+ {
101
+ :'account_number' => :'account_number',
102
+ :'apr' => :'apr',
103
+ :'apy' => :'apy',
104
+ :'available_balance' => :'available_balance',
105
+ :'available_credit' => :'available_credit',
106
+ :'balance' => :'balance',
107
+ :'cash_balance' => :'cash_balance',
108
+ :'cash_surrender_value' => :'cash_surrender_value',
109
+ :'created_at' => :'created_at',
110
+ :'credit_limit' => :'credit_limit',
111
+ :'currency_code' => :'currency_code',
112
+ :'day_payment_is_due' => :'day_payment_is_due',
113
+ :'death_benefit' => :'death_benefit',
114
+ :'guid' => :'guid',
115
+ :'holdings_value' => :'holdings_value',
116
+ :'id' => :'id',
117
+ :'institution_code' => :'institution_code',
118
+ :'insured_name' => :'insured_name',
119
+ :'interest_rate' => :'interest_rate',
120
+ :'is_closed' => :'is_closed',
121
+ :'is_hidden' => :'is_hidden',
122
+ :'last_payment' => :'last_payment',
123
+ :'last_payment_at' => :'last_payment_at',
124
+ :'loan_amount' => :'loan_amount',
125
+ :'matures_on' => :'matures_on',
126
+ :'member_guid' => :'member_guid',
127
+ :'minimum_balance' => :'minimum_balance',
128
+ :'minimum_payment' => :'minimum_payment',
129
+ :'name' => :'name',
130
+ :'original_balance' => :'original_balance',
131
+ :'pay_out_amount' => :'pay_out_amount',
132
+ :'payment_due_at' => :'payment_due_at',
133
+ :'payoff_balance' => :'payoff_balance',
134
+ :'premium_amount' => :'premium_amount',
135
+ :'started_on' => :'started_on',
136
+ :'subtype' => :'subtype',
137
+ :'total_account_value' => :'total_account_value',
138
+ :'type' => :'type',
139
+ :'updated_at' => :'updated_at',
140
+ :'user_guid' => :'user_guid'
141
+ }
142
+ end
143
+
144
+ # Returns all the JSON keys this model knows about
145
+ def self.acceptable_attributes
146
+ attribute_map.values
147
+ end
148
+
149
+ # Attribute type mapping.
150
+ def self.openapi_types
151
+ {
152
+ :'account_number' => :'String',
153
+ :'apr' => :'Float',
154
+ :'apy' => :'Float',
155
+ :'available_balance' => :'Float',
156
+ :'available_credit' => :'Float',
157
+ :'balance' => :'Float',
158
+ :'cash_balance' => :'Float',
159
+ :'cash_surrender_value' => :'Float',
160
+ :'created_at' => :'String',
161
+ :'credit_limit' => :'Float',
162
+ :'currency_code' => :'String',
163
+ :'day_payment_is_due' => :'Integer',
164
+ :'death_benefit' => :'Integer',
165
+ :'guid' => :'String',
166
+ :'holdings_value' => :'Float',
167
+ :'id' => :'String',
168
+ :'institution_code' => :'String',
169
+ :'insured_name' => :'String',
170
+ :'interest_rate' => :'Float',
171
+ :'is_closed' => :'Boolean',
172
+ :'is_hidden' => :'Boolean',
173
+ :'last_payment' => :'Float',
174
+ :'last_payment_at' => :'String',
175
+ :'loan_amount' => :'Float',
176
+ :'matures_on' => :'String',
177
+ :'member_guid' => :'String',
178
+ :'minimum_balance' => :'Float',
179
+ :'minimum_payment' => :'Float',
180
+ :'name' => :'String',
181
+ :'original_balance' => :'Float',
182
+ :'pay_out_amount' => :'Float',
183
+ :'payment_due_at' => :'String',
184
+ :'payoff_balance' => :'Float',
185
+ :'premium_amount' => :'Float',
186
+ :'started_on' => :'String',
187
+ :'subtype' => :'String',
188
+ :'total_account_value' => :'Float',
189
+ :'type' => :'String',
190
+ :'updated_at' => :'String',
191
+ :'user_guid' => :'String'
192
+ }
193
+ end
194
+
195
+ # List of attributes with nullable: true
196
+ def self.openapi_nullable
197
+ Set.new([
198
+ ])
199
+ end
200
+
201
+ # Initializes the object
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ def initialize(attributes = {})
204
+ if (!attributes.is_a?(Hash))
205
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MxPlatformRuby::Account` initialize method"
206
+ end
207
+
208
+ # check to see if the attribute exists and convert string to symbol for hash key
209
+ attributes = attributes.each_with_object({}) { |(k, v), h|
210
+ if (!self.class.attribute_map.key?(k.to_sym))
211
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MxPlatformRuby::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
212
+ end
213
+ h[k.to_sym] = v
214
+ }
215
+
216
+ if attributes.key?(:'account_number')
217
+ self.account_number = attributes[:'account_number']
218
+ end
219
+
220
+ if attributes.key?(:'apr')
221
+ self.apr = attributes[:'apr']
222
+ end
223
+
224
+ if attributes.key?(:'apy')
225
+ self.apy = attributes[:'apy']
226
+ end
227
+
228
+ if attributes.key?(:'available_balance')
229
+ self.available_balance = attributes[:'available_balance']
230
+ end
231
+
232
+ if attributes.key?(:'available_credit')
233
+ self.available_credit = attributes[:'available_credit']
234
+ end
235
+
236
+ if attributes.key?(:'balance')
237
+ self.balance = attributes[:'balance']
238
+ end
239
+
240
+ if attributes.key?(:'cash_balance')
241
+ self.cash_balance = attributes[:'cash_balance']
242
+ end
243
+
244
+ if attributes.key?(:'cash_surrender_value')
245
+ self.cash_surrender_value = attributes[:'cash_surrender_value']
246
+ end
247
+
248
+ if attributes.key?(:'created_at')
249
+ self.created_at = attributes[:'created_at']
250
+ end
251
+
252
+ if attributes.key?(:'credit_limit')
253
+ self.credit_limit = attributes[:'credit_limit']
254
+ end
255
+
256
+ if attributes.key?(:'currency_code')
257
+ self.currency_code = attributes[:'currency_code']
258
+ end
259
+
260
+ if attributes.key?(:'day_payment_is_due')
261
+ self.day_payment_is_due = attributes[:'day_payment_is_due']
262
+ end
263
+
264
+ if attributes.key?(:'death_benefit')
265
+ self.death_benefit = attributes[:'death_benefit']
266
+ end
267
+
268
+ if attributes.key?(:'guid')
269
+ self.guid = attributes[:'guid']
270
+ end
271
+
272
+ if attributes.key?(:'holdings_value')
273
+ self.holdings_value = attributes[:'holdings_value']
274
+ end
275
+
276
+ if attributes.key?(:'id')
277
+ self.id = attributes[:'id']
278
+ end
279
+
280
+ if attributes.key?(:'institution_code')
281
+ self.institution_code = attributes[:'institution_code']
282
+ end
283
+
284
+ if attributes.key?(:'insured_name')
285
+ self.insured_name = attributes[:'insured_name']
286
+ end
287
+
288
+ if attributes.key?(:'interest_rate')
289
+ self.interest_rate = attributes[:'interest_rate']
290
+ end
291
+
292
+ if attributes.key?(:'is_closed')
293
+ self.is_closed = attributes[:'is_closed']
294
+ end
295
+
296
+ if attributes.key?(:'is_hidden')
297
+ self.is_hidden = attributes[:'is_hidden']
298
+ end
299
+
300
+ if attributes.key?(:'last_payment')
301
+ self.last_payment = attributes[:'last_payment']
302
+ end
303
+
304
+ if attributes.key?(:'last_payment_at')
305
+ self.last_payment_at = attributes[:'last_payment_at']
306
+ end
307
+
308
+ if attributes.key?(:'loan_amount')
309
+ self.loan_amount = attributes[:'loan_amount']
310
+ end
311
+
312
+ if attributes.key?(:'matures_on')
313
+ self.matures_on = attributes[:'matures_on']
314
+ end
315
+
316
+ if attributes.key?(:'member_guid')
317
+ self.member_guid = attributes[:'member_guid']
318
+ end
319
+
320
+ if attributes.key?(:'minimum_balance')
321
+ self.minimum_balance = attributes[:'minimum_balance']
322
+ end
323
+
324
+ if attributes.key?(:'minimum_payment')
325
+ self.minimum_payment = attributes[:'minimum_payment']
326
+ end
327
+
328
+ if attributes.key?(:'name')
329
+ self.name = attributes[:'name']
330
+ end
331
+
332
+ if attributes.key?(:'original_balance')
333
+ self.original_balance = attributes[:'original_balance']
334
+ end
335
+
336
+ if attributes.key?(:'pay_out_amount')
337
+ self.pay_out_amount = attributes[:'pay_out_amount']
338
+ end
339
+
340
+ if attributes.key?(:'payment_due_at')
341
+ self.payment_due_at = attributes[:'payment_due_at']
342
+ end
343
+
344
+ if attributes.key?(:'payoff_balance')
345
+ self.payoff_balance = attributes[:'payoff_balance']
346
+ end
347
+
348
+ if attributes.key?(:'premium_amount')
349
+ self.premium_amount = attributes[:'premium_amount']
350
+ end
351
+
352
+ if attributes.key?(:'started_on')
353
+ self.started_on = attributes[:'started_on']
354
+ end
355
+
356
+ if attributes.key?(:'subtype')
357
+ self.subtype = attributes[:'subtype']
358
+ end
359
+
360
+ if attributes.key?(:'total_account_value')
361
+ self.total_account_value = attributes[:'total_account_value']
362
+ end
363
+
364
+ if attributes.key?(:'type')
365
+ self.type = attributes[:'type']
366
+ end
367
+
368
+ if attributes.key?(:'updated_at')
369
+ self.updated_at = attributes[:'updated_at']
370
+ end
371
+
372
+ if attributes.key?(:'user_guid')
373
+ self.user_guid = attributes[:'user_guid']
374
+ end
375
+ end
376
+
377
+ # Show invalid properties with the reasons. Usually used together with valid?
378
+ # @return Array for valid properties with the reasons
379
+ def list_invalid_properties
380
+ invalid_properties = Array.new
381
+ invalid_properties
382
+ end
383
+
384
+ # Check to see if the all the properties in the model are valid
385
+ # @return true if the model is valid
386
+ def valid?
387
+ true
388
+ end
389
+
390
+ # Checks equality by comparing each attribute.
391
+ # @param [Object] Object to be compared
392
+ def ==(o)
393
+ return true if self.equal?(o)
394
+ self.class == o.class &&
395
+ account_number == o.account_number &&
396
+ apr == o.apr &&
397
+ apy == o.apy &&
398
+ available_balance == o.available_balance &&
399
+ available_credit == o.available_credit &&
400
+ balance == o.balance &&
401
+ cash_balance == o.cash_balance &&
402
+ cash_surrender_value == o.cash_surrender_value &&
403
+ created_at == o.created_at &&
404
+ credit_limit == o.credit_limit &&
405
+ currency_code == o.currency_code &&
406
+ day_payment_is_due == o.day_payment_is_due &&
407
+ death_benefit == o.death_benefit &&
408
+ guid == o.guid &&
409
+ holdings_value == o.holdings_value &&
410
+ id == o.id &&
411
+ institution_code == o.institution_code &&
412
+ insured_name == o.insured_name &&
413
+ interest_rate == o.interest_rate &&
414
+ is_closed == o.is_closed &&
415
+ is_hidden == o.is_hidden &&
416
+ last_payment == o.last_payment &&
417
+ last_payment_at == o.last_payment_at &&
418
+ loan_amount == o.loan_amount &&
419
+ matures_on == o.matures_on &&
420
+ member_guid == o.member_guid &&
421
+ minimum_balance == o.minimum_balance &&
422
+ minimum_payment == o.minimum_payment &&
423
+ name == o.name &&
424
+ original_balance == o.original_balance &&
425
+ pay_out_amount == o.pay_out_amount &&
426
+ payment_due_at == o.payment_due_at &&
427
+ payoff_balance == o.payoff_balance &&
428
+ premium_amount == o.premium_amount &&
429
+ started_on == o.started_on &&
430
+ subtype == o.subtype &&
431
+ total_account_value == o.total_account_value &&
432
+ type == o.type &&
433
+ updated_at == o.updated_at &&
434
+ user_guid == o.user_guid
435
+ end
436
+
437
+ # @see the `==` method
438
+ # @param [Object] Object to be compared
439
+ def eql?(o)
440
+ self == o
441
+ end
442
+
443
+ # Calculates hash code according to all attributes.
444
+ # @return [Integer] Hash code
445
+ def hash
446
+ [account_number, apr, apy, available_balance, available_credit, balance, cash_balance, cash_surrender_value, created_at, credit_limit, currency_code, day_payment_is_due, death_benefit, guid, holdings_value, id, institution_code, insured_name, interest_rate, is_closed, is_hidden, last_payment, last_payment_at, loan_amount, matures_on, member_guid, minimum_balance, minimum_payment, name, original_balance, pay_out_amount, payment_due_at, payoff_balance, premium_amount, started_on, subtype, total_account_value, type, updated_at, user_guid].hash
447
+ end
448
+
449
+ # Builds the object from hash
450
+ # @param [Hash] attributes Model attributes in the form of hash
451
+ # @return [Object] Returns the model itself
452
+ def self.build_from_hash(attributes)
453
+ new.build_from_hash(attributes)
454
+ end
455
+
456
+ # Builds the object from hash
457
+ # @param [Hash] attributes Model attributes in the form of hash
458
+ # @return [Object] Returns the model itself
459
+ def build_from_hash(attributes)
460
+ return nil unless attributes.is_a?(Hash)
461
+ self.class.openapi_types.each_pair do |key, type|
462
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
463
+ self.send("#{key}=", nil)
464
+ elsif type =~ /\AArray<(.*)>/i
465
+ # check to ensure the input is an array given that the attribute
466
+ # is documented as an array but the input is not
467
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
468
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
469
+ end
470
+ elsif !attributes[self.class.attribute_map[key]].nil?
471
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
472
+ end
473
+ end
474
+
475
+ self
476
+ end
477
+
478
+ # Deserializes the data based on type
479
+ # @param string type Data type
480
+ # @param string value Value to be deserialized
481
+ # @return [Object] Deserialized data
482
+ def _deserialize(type, value)
483
+ case type.to_sym
484
+ when :Time
485
+ Time.parse(value)
486
+ when :Date
487
+ Date.parse(value)
488
+ when :String
489
+ value.to_s
490
+ when :Integer
491
+ value.to_i
492
+ when :Float
493
+ value.to_f
494
+ when :Boolean
495
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
496
+ true
497
+ else
498
+ false
499
+ end
500
+ when :Object
501
+ # generic object (usually a Hash), return directly
502
+ value
503
+ when /\AArray<(?<inner_type>.+)>\z/
504
+ inner_type = Regexp.last_match[:inner_type]
505
+ value.map { |v| _deserialize(inner_type, v) }
506
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
507
+ k_type = Regexp.last_match[:k_type]
508
+ v_type = Regexp.last_match[:v_type]
509
+ {}.tap do |hash|
510
+ value.each do |k, v|
511
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
512
+ end
513
+ end
514
+ else # model
515
+ # models (e.g. Pet) or oneOf
516
+ klass = MxPlatformRuby.const_get(type)
517
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
518
+ end
519
+ end
520
+
521
+ # Returns the string representation of the object
522
+ # @return [String] String presentation of the object
523
+ def to_s
524
+ to_hash.to_s
525
+ end
526
+
527
+ # to_body is an alias to to_hash (backward compatibility)
528
+ # @return [Hash] Returns the object in the form of hash
529
+ def to_body
530
+ to_hash
531
+ end
532
+
533
+ # Returns the object in the form of hash
534
+ # @return [Hash] Returns the object in the form of hash
535
+ def to_hash
536
+ hash = {}
537
+ self.class.attribute_map.each_pair do |attr, param|
538
+ value = self.send(attr)
539
+ if value.nil?
540
+ is_nullable = self.class.openapi_nullable.include?(attr)
541
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
542
+ end
543
+
544
+ hash[param] = _to_hash(value)
545
+ end
546
+ hash
547
+ end
548
+
549
+ # Outputs non-array value in the form of hash
550
+ # For object, use to_hash. Otherwise, just return the value
551
+ # @param [Object] value Any valid value
552
+ # @return [Hash] Returns the value in the form of hash
553
+ def _to_hash(value)
554
+ if value.is_a?(Array)
555
+ value.compact.map { |v| _to_hash(v) }
556
+ elsif value.is_a?(Hash)
557
+ {}.tap do |hash|
558
+ value.each { |k, v| hash[k] = _to_hash(v) }
559
+ end
560
+ elsif value.respond_to? :to_hash
561
+ value.to_hash
562
+ else
563
+ value
564
+ end
565
+ end
566
+
567
+ end
568
+
569
+ end