fuse_client 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/2023-01-25.json +1736 -0
- data/fuse-ruby-openapi/.gitignore +39 -0
- data/fuse-ruby-openapi/.gitlab-ci.yml +26 -0
- data/fuse-ruby-openapi/.openapi-generator/FILES +220 -0
- data/fuse-ruby-openapi/.openapi-generator/VERSION +1 -0
- data/fuse-ruby-openapi/.openapi-generator-ignore +23 -0
- data/fuse-ruby-openapi/.rspec +2 -0
- data/fuse-ruby-openapi/.rubocop.yml +148 -0
- data/fuse-ruby-openapi/.travis.yml +14 -0
- data/fuse-ruby-openapi/Gemfile +9 -0
- data/fuse-ruby-openapi/README.md +258 -0
- data/fuse-ruby-openapi/Rakefile +10 -0
- data/fuse-ruby-openapi/docs/CreateAssetReportRequest.md +20 -0
- data/fuse-ruby-openapi/docs/CreateAssetReportResponse.md +20 -0
- data/fuse-ruby-openapi/docs/CreateLinkTokenRequest.md +28 -0
- data/fuse-ruby-openapi/docs/CreateLinkTokenRequestMx.md +18 -0
- data/fuse-ruby-openapi/docs/CreateLinkTokenRequestPlaid.md +18 -0
- data/fuse-ruby-openapi/docs/CreateLinkTokenRequestPlaidConfig.md +18 -0
- data/fuse-ruby-openapi/docs/CreateLinkTokenResponse.md +20 -0
- data/fuse-ruby-openapi/docs/CreateSessionRequest.md +22 -0
- data/fuse-ruby-openapi/docs/CreateSessionRequestMx.md +24 -0
- data/fuse-ruby-openapi/docs/CreateSessionRequestPlaid.md +18 -0
- data/fuse-ruby-openapi/docs/CreateSessionResponse.md +22 -0
- data/fuse-ruby-openapi/docs/ExchangeFinancialConnectionsPublicTokenRequest.md +18 -0
- data/fuse-ruby-openapi/docs/ExchangeFinancialConnectionsPublicTokenResponse.md +22 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccount.md +32 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountBalance.md +24 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountDetails.md +22 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountDetailsAch.md +24 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountInstitution.md +18 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountLiability.md +46 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountLiabilityAllOf.md +30 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsAccountLiabilityAllOfAprs.md +20 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsHolding.md +26 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsInvestmentAccount.md +32 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsInvestmentSecurity.md +26 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsInvestmentTransaction.md +18 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsInvestmentTransactionDataInner.md +32 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsOwner.md +24 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsOwnerAddressesInner.md +20 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsOwnerAddressesInnerData.md +26 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsOwnerEmailsInner.md +22 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsOwnerNamesInner.md +20 -0
- data/fuse-ruby-openapi/docs/FinancialConnectionsOwnerPhoneNumbersInner.md +22 -0
- data/fuse-ruby-openapi/docs/FuseApi.md +1154 -0
- data/fuse-ruby-openapi/docs/FuseApiError.md +28 -0
- data/fuse-ruby-openapi/docs/FuseApiErrorData.md +20 -0
- data/fuse-ruby-openapi/docs/FuseApiWarning.md +28 -0
- data/fuse-ruby-openapi/docs/FuseApiWarningData.md +20 -0
- data/fuse-ruby-openapi/docs/GetAssetReportRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetAssetReportResponse.md +18 -0
- data/fuse-ruby-openapi/docs/GetAssetReportResponseReport.md +28 -0
- data/fuse-ruby-openapi/docs/GetAssetReportResponseReportAccountsInner.md +24 -0
- data/fuse-ruby-openapi/docs/GetAssetReportResponseReportAccountsInnerBalances.md +22 -0
- data/fuse-ruby-openapi/docs/GetAssetReportResponseReportAccountsInnerHistoricalBalancesInner.md +22 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsAccountBalanceResponse.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsAccountDetailsRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsAccountDetailsResponse.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsAccountsRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsAccountsResponse.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsBalanceRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsOwnersRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsOwnersResponse.md +18 -0
- data/fuse-ruby-openapi/docs/GetFinancialConnectionsOwnersResponseAccountsInner.md +20 -0
- data/fuse-ruby-openapi/docs/GetInvestmentHoldingsRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetInvestmentHoldingsResponse.md +24 -0
- data/fuse-ruby-openapi/docs/GetInvestmentTransactionsRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetInvestmentTransactionsResponse.md +24 -0
- data/fuse-ruby-openapi/docs/GetLiabilitiesRequest.md +18 -0
- data/fuse-ruby-openapi/docs/GetLiabilitiesResponse.md +20 -0
- data/fuse-ruby-openapi/docs/GetTransactionsRequest.md +22 -0
- data/fuse-ruby-openapi/docs/GetTransactionsResponse.md +22 -0
- data/fuse-ruby-openapi/docs/GetTransactionsResponseDataInner.md +38 -0
- data/fuse-ruby-openapi/docs/GetTransactionsResponseDataInnerMerchant.md +18 -0
- data/fuse-ruby-openapi/docs/SyncFinancialConnectionsDataResponse.md +18 -0
- data/fuse-ruby-openapi/docs/SyncTransactionsRequest.md +22 -0
- data/fuse-ruby-openapi/docs/SyncTransactionsResponse.md +26 -0
- data/fuse-ruby-openapi/docs/SyncTransactionsResponseRemovedInner.md +18 -0
- data/fuse-ruby-openapi/docs/TransactionCommonModel.md +18 -0
- data/fuse-ruby-openapi/fuse_client.gemspec +38 -0
- data/fuse-ruby-openapi/git_push.sh +57 -0
- data/fuse-ruby-openapi/lib/fuse_client/api/fuse_api.rb +994 -0
- data/fuse-ruby-openapi/lib/fuse_client/api_client.rb +392 -0
- data/fuse-ruby-openapi/lib/fuse_client/api_error.rb +57 -0
- data/fuse-ruby-openapi/lib/fuse_client/configuration.rb +349 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_asset_report_request.rb +268 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_asset_report_response.rb +230 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_link_token_request.rb +277 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_link_token_request_mx.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_link_token_request_plaid.rb +220 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_link_token_request_plaid_config.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_link_token_response.rb +230 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_session_request.rb +266 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_session_request_mx.rb +247 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_session_request_plaid.rb +238 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/create_session_response.rb +240 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/exchange_financial_connections_public_token_request.rb +220 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/exchange_financial_connections_public_token_response.rb +240 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account.rb +288 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_balance.rb +250 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_details.rb +239 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_details_ach.rb +250 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_institution.rb +219 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_liability.rb +368 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_liability_all_of.rb +282 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_account_liability_all_of_aprs.rb +230 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_holding.rb +260 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_investment_account.rb +288 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_investment_security.rb +260 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_investment_transaction.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_investment_transaction_data_inner.rb +290 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_owner.rb +255 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_owner_addresses_inner.rb +229 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_owner_addresses_inner_data.rb +260 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_owner_emails_inner.rb +274 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_owner_names_inner.rb +230 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/financial_connections_owner_phone_numbers_inner.rb +274 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/fuse_api_error.rb +298 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/fuse_api_error_data.rb +230 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/fuse_api_warning.rb +298 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/fuse_api_warning_data.rb +230 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_asset_report_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_asset_report_response.rb +219 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_asset_report_response_report.rb +275 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_asset_report_response_report_accounts_inner.rb +252 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_asset_report_response_report_accounts_inner_balances.rb +240 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_asset_report_response_report_accounts_inner_historical_balances_inner.rb +240 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_account_balance_response.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_account_details_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_account_details_response.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_accounts_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_accounts_response.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_balance_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_owners_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_owners_response.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_financial_connections_owners_response_accounts_inner.rb +231 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_investment_holdings_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_investment_holdings_response.rb +253 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_investment_transactions_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_investment_transactions_response.rb +253 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_liabilities_request.rb +225 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_liabilities_response.rb +231 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_transactions_request.rb +245 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_transactions_response.rb +241 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_transactions_response_data_inner.rb +321 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/get_transactions_response_data_inner_merchant.rb +220 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/sync_financial_connections_data_response.rb +220 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/sync_transactions_request.rb +245 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/sync_transactions_response.rb +266 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/sync_transactions_response_removed_inner.rb +219 -0
- data/fuse-ruby-openapi/lib/fuse_client/models/transaction_common_model.rb +221 -0
- data/fuse-ruby-openapi/lib/fuse_client/version.rb +15 -0
- data/fuse-ruby-openapi/lib/fuse_client.rb +106 -0
- data/fuse-ruby-openapi/spec/api/fuse_api_spec.rb +201 -0
- data/fuse-ruby-openapi/spec/api_client_spec.rb +226 -0
- data/fuse-ruby-openapi/spec/configuration_spec.rb +42 -0
- data/fuse-ruby-openapi/spec/models/create_asset_report_request_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/create_asset_report_response_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/create_link_token_request_mx_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/create_link_token_request_plaid_config_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/create_link_token_request_plaid_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/create_link_token_request_spec.rb +64 -0
- data/fuse-ruby-openapi/spec/models/create_link_token_response_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/create_session_request_mx_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/create_session_request_plaid_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/create_session_request_spec.rb +50 -0
- data/fuse-ruby-openapi/spec/models/create_session_response_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/exchange_financial_connections_public_token_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/exchange_financial_connections_public_token_response_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_balance_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_details_ach_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_details_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_institution_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_liability_all_of_aprs_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_liability_all_of_spec.rb +70 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_liability_spec.rb +118 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_account_spec.rb +76 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_holding_spec.rb +58 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_investment_account_spec.rb +76 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_investment_security_spec.rb +58 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_investment_transaction_data_inner_spec.rb +76 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_investment_transaction_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_owner_addresses_inner_data_spec.rb +58 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_owner_addresses_inner_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_owner_emails_inner_spec.rb +50 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_owner_names_inner_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_owner_phone_numbers_inner_spec.rb +50 -0
- data/fuse-ruby-openapi/spec/models/financial_connections_owner_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/fuse_api_error_data_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/fuse_api_error_spec.rb +68 -0
- data/fuse-ruby-openapi/spec/models/fuse_api_warning_data_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/fuse_api_warning_spec.rb +68 -0
- data/fuse-ruby-openapi/spec/models/get_asset_report_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_asset_report_response_report_accounts_inner_balances_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/get_asset_report_response_report_accounts_inner_historical_balances_inner_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/get_asset_report_response_report_accounts_inner_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/get_asset_report_response_report_spec.rb +64 -0
- data/fuse-ruby-openapi/spec/models/get_asset_report_response_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_account_balance_response_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_account_details_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_account_details_response_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_accounts_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_accounts_response_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_balance_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_owners_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_owners_response_accounts_inner_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/get_financial_connections_owners_response_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_investment_holdings_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_investment_holdings_response_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/get_investment_transactions_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_investment_transactions_response_spec.rb +52 -0
- data/fuse-ruby-openapi/spec/models/get_liabilities_request_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_liabilities_response_spec.rb +40 -0
- data/fuse-ruby-openapi/spec/models/get_transactions_request_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/get_transactions_response_data_inner_merchant_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/get_transactions_response_data_inner_spec.rb +94 -0
- data/fuse-ruby-openapi/spec/models/get_transactions_response_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/sync_financial_connections_data_response_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/sync_transactions_request_spec.rb +46 -0
- data/fuse-ruby-openapi/spec/models/sync_transactions_response_removed_inner_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/models/sync_transactions_response_spec.rb +58 -0
- data/fuse-ruby-openapi/spec/models/transaction_common_model_spec.rb +34 -0
- data/fuse-ruby-openapi/spec/spec_helper.rb +111 -0
- data/generate-fuse-openapi-spec.js +136 -0
- metadata +307 -0
@@ -0,0 +1,349 @@
|
|
1
|
+
=begin
|
2
|
+
#Fuse
|
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
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module FuseClient
|
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 :verify_ssl
|
102
|
+
|
103
|
+
### TLS/SSL setting
|
104
|
+
# Set this to false to skip verifying SSL host name
|
105
|
+
# Default to true.
|
106
|
+
#
|
107
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
108
|
+
#
|
109
|
+
# @return [true, false]
|
110
|
+
attr_accessor :verify_ssl_host
|
111
|
+
|
112
|
+
### TLS/SSL setting
|
113
|
+
# Set this to customize the certificate file to verify the peer.
|
114
|
+
#
|
115
|
+
# @return [String] the path to the certificate file
|
116
|
+
#
|
117
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
118
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
119
|
+
attr_accessor :ssl_ca_cert
|
120
|
+
|
121
|
+
### TLS/SSL setting
|
122
|
+
# Client certificate file (for client certificate)
|
123
|
+
attr_accessor :cert_file
|
124
|
+
|
125
|
+
### TLS/SSL setting
|
126
|
+
# Client private key file (for client certificate)
|
127
|
+
attr_accessor :key_file
|
128
|
+
|
129
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
130
|
+
# Default to nil.
|
131
|
+
#
|
132
|
+
# @see The params_encoding option of Ethon. Related source code:
|
133
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
134
|
+
attr_accessor :params_encoding
|
135
|
+
|
136
|
+
|
137
|
+
attr_accessor :inject_format
|
138
|
+
|
139
|
+
attr_accessor :force_ending_format
|
140
|
+
|
141
|
+
def initialize
|
142
|
+
@scheme = 'https'
|
143
|
+
@host = 'yz9sph5c42.execute-api.us-east-1.amazonaws.com'
|
144
|
+
@base_path = ''
|
145
|
+
@server_index = 0
|
146
|
+
@server_operation_index = {}
|
147
|
+
@server_variables = {}
|
148
|
+
@server_operation_variables = {}
|
149
|
+
@api_key = {}
|
150
|
+
@api_key_prefix = {}
|
151
|
+
@client_side_validation = true
|
152
|
+
@verify_ssl = true
|
153
|
+
@verify_ssl_host = true
|
154
|
+
@cert_file = nil
|
155
|
+
@key_file = nil
|
156
|
+
@timeout = 0
|
157
|
+
@params_encoding = nil
|
158
|
+
@debugging = false
|
159
|
+
@inject_format = false
|
160
|
+
@force_ending_format = false
|
161
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
162
|
+
|
163
|
+
yield(self) if block_given?
|
164
|
+
end
|
165
|
+
|
166
|
+
# The default Configuration object.
|
167
|
+
def self.default
|
168
|
+
@@default ||= Configuration.new
|
169
|
+
end
|
170
|
+
|
171
|
+
def configure
|
172
|
+
yield(self) if block_given?
|
173
|
+
end
|
174
|
+
|
175
|
+
def scheme=(scheme)
|
176
|
+
# remove :// from scheme
|
177
|
+
@scheme = scheme.sub(/:\/\//, '')
|
178
|
+
end
|
179
|
+
|
180
|
+
def host=(host)
|
181
|
+
# remove http(s):// and anything after a slash
|
182
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
183
|
+
end
|
184
|
+
|
185
|
+
def base_path=(base_path)
|
186
|
+
# Add leading and trailing slashes to base_path
|
187
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
188
|
+
@base_path = '' if @base_path == '/'
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns base URL for specified operation based on server settings
|
192
|
+
def base_url(operation = nil)
|
193
|
+
index = server_operation_index.fetch(operation, server_index)
|
194
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
|
195
|
+
|
196
|
+
server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
197
|
+
end
|
198
|
+
|
199
|
+
# Gets API key (with prefix if set).
|
200
|
+
# @param [String] param_name the parameter name of API key auth
|
201
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
202
|
+
key = @api_key[param_name]
|
203
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
204
|
+
if @api_key_prefix[param_name]
|
205
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
206
|
+
else
|
207
|
+
key
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# Gets Basic Auth token string
|
212
|
+
def basic_auth_token
|
213
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns Auth Settings hash for api client.
|
217
|
+
def auth_settings
|
218
|
+
{
|
219
|
+
'fuseApiKey' =>
|
220
|
+
{
|
221
|
+
type: 'api_key',
|
222
|
+
in: 'header',
|
223
|
+
key: 'Fuse-Api-Key',
|
224
|
+
value: api_key_with_prefix('fuseApiKey')
|
225
|
+
},
|
226
|
+
'fuseClientId' =>
|
227
|
+
{
|
228
|
+
type: 'api_key',
|
229
|
+
in: 'header',
|
230
|
+
key: 'Fuse-Client-Id',
|
231
|
+
value: api_key_with_prefix('fuseClientId')
|
232
|
+
},
|
233
|
+
'mxApiKey' =>
|
234
|
+
{
|
235
|
+
type: 'api_key',
|
236
|
+
in: 'header',
|
237
|
+
key: 'Mx-Api-Key',
|
238
|
+
value: api_key_with_prefix('mxApiKey')
|
239
|
+
},
|
240
|
+
'mxClientId' =>
|
241
|
+
{
|
242
|
+
type: 'api_key',
|
243
|
+
in: 'header',
|
244
|
+
key: 'Mx-Client-Id',
|
245
|
+
value: api_key_with_prefix('mxClientId')
|
246
|
+
},
|
247
|
+
'plaidClientId' =>
|
248
|
+
{
|
249
|
+
type: 'api_key',
|
250
|
+
in: 'header',
|
251
|
+
key: 'Plaid-Client-Id',
|
252
|
+
value: api_key_with_prefix('plaidClientId')
|
253
|
+
},
|
254
|
+
'plaidSecret' =>
|
255
|
+
{
|
256
|
+
type: 'api_key',
|
257
|
+
in: 'header',
|
258
|
+
key: 'Plaid-Secret',
|
259
|
+
value: api_key_with_prefix('plaidSecret')
|
260
|
+
},
|
261
|
+
'tellerApplicationId' =>
|
262
|
+
{
|
263
|
+
type: 'api_key',
|
264
|
+
in: 'header',
|
265
|
+
key: 'Teller-Application-Id',
|
266
|
+
value: api_key_with_prefix('tellerApplicationId')
|
267
|
+
},
|
268
|
+
'tellerCertificate' =>
|
269
|
+
{
|
270
|
+
type: 'api_key',
|
271
|
+
in: 'header',
|
272
|
+
key: 'Teller-Certificate',
|
273
|
+
value: api_key_with_prefix('tellerCertificate')
|
274
|
+
},
|
275
|
+
'tellerPrivateKey' =>
|
276
|
+
{
|
277
|
+
type: 'api_key',
|
278
|
+
in: 'header',
|
279
|
+
key: 'Teller-Private-Key',
|
280
|
+
value: api_key_with_prefix('tellerPrivateKey')
|
281
|
+
},
|
282
|
+
'tellerSigningSecret' =>
|
283
|
+
{
|
284
|
+
type: 'api_key',
|
285
|
+
in: 'header',
|
286
|
+
key: 'Teller-Signing-Secret',
|
287
|
+
value: api_key_with_prefix('tellerSigningSecret')
|
288
|
+
},
|
289
|
+
'tellerTokenSigningKey' =>
|
290
|
+
{
|
291
|
+
type: 'api_key',
|
292
|
+
in: 'header',
|
293
|
+
key: 'Teller-Token-Signing-Key',
|
294
|
+
value: api_key_with_prefix('tellerTokenSigningKey')
|
295
|
+
},
|
296
|
+
}
|
297
|
+
end
|
298
|
+
|
299
|
+
# Returns an array of Server setting
|
300
|
+
def server_settings
|
301
|
+
[
|
302
|
+
{
|
303
|
+
url: "https://yz9sph5c42.execute-api.us-east-1.amazonaws.com",
|
304
|
+
description: "sandbox",
|
305
|
+
}
|
306
|
+
]
|
307
|
+
end
|
308
|
+
|
309
|
+
def operation_server_settings
|
310
|
+
{
|
311
|
+
}
|
312
|
+
end
|
313
|
+
|
314
|
+
# Returns URL based on server settings
|
315
|
+
#
|
316
|
+
# @param index array index of the server settings
|
317
|
+
# @param variables hash of variable and the corresponding value
|
318
|
+
def server_url(index, variables = {}, servers = nil)
|
319
|
+
servers = server_settings if servers == nil
|
320
|
+
|
321
|
+
# check array index out of bound
|
322
|
+
if (index < 0 || index >= servers.size)
|
323
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
324
|
+
end
|
325
|
+
|
326
|
+
server = servers[index]
|
327
|
+
url = server[:url]
|
328
|
+
|
329
|
+
return url unless server.key? :variables
|
330
|
+
|
331
|
+
# go through variable and assign a value
|
332
|
+
server[:variables].each do |name, variable|
|
333
|
+
if variables.key?(name)
|
334
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
335
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
336
|
+
else
|
337
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
338
|
+
end
|
339
|
+
else
|
340
|
+
# use default value
|
341
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
url
|
346
|
+
end
|
347
|
+
|
348
|
+
end
|
349
|
+
end
|
@@ -0,0 +1,268 @@
|
|
1
|
+
=begin
|
2
|
+
#Fuse
|
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
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module FuseClient
|
17
|
+
class CreateAssetReportRequest
|
18
|
+
# Access token for the entity to create report for.
|
19
|
+
attr_accessor :access_token
|
20
|
+
|
21
|
+
# The maximum integer number of days of history to include in the Asset Report
|
22
|
+
attr_accessor :days_requested
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'access_token' => :'access_token',
|
28
|
+
:'days_requested' => :'days_requested'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'access_token' => :'String',
|
41
|
+
:'days_requested' => :'Float'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateAssetReportRequest` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateAssetReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'access_token')
|
67
|
+
self.access_token = attributes[:'access_token']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'days_requested')
|
71
|
+
self.days_requested = attributes[:'days_requested']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if @access_token.nil?
|
80
|
+
invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
if @days_requested.nil?
|
84
|
+
invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.')
|
85
|
+
end
|
86
|
+
|
87
|
+
if @days_requested > 365
|
88
|
+
invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 365.')
|
89
|
+
end
|
90
|
+
|
91
|
+
if @days_requested < 1
|
92
|
+
invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.')
|
93
|
+
end
|
94
|
+
|
95
|
+
invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
return false if @access_token.nil?
|
102
|
+
return false if @days_requested.nil?
|
103
|
+
return false if @days_requested > 365
|
104
|
+
return false if @days_requested < 1
|
105
|
+
true
|
106
|
+
end
|
107
|
+
|
108
|
+
# Custom attribute writer method with validation
|
109
|
+
# @param [Object] days_requested Value to be assigned
|
110
|
+
def days_requested=(days_requested)
|
111
|
+
if days_requested.nil?
|
112
|
+
fail ArgumentError, 'days_requested cannot be nil'
|
113
|
+
end
|
114
|
+
|
115
|
+
if days_requested > 365
|
116
|
+
fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 365.'
|
117
|
+
end
|
118
|
+
|
119
|
+
if days_requested < 1
|
120
|
+
fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.'
|
121
|
+
end
|
122
|
+
|
123
|
+
@days_requested = days_requested
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
access_token == o.access_token &&
|
132
|
+
days_requested == o.days_requested
|
133
|
+
end
|
134
|
+
|
135
|
+
# @see the `==` method
|
136
|
+
# @param [Object] Object to be compared
|
137
|
+
def eql?(o)
|
138
|
+
self == o
|
139
|
+
end
|
140
|
+
|
141
|
+
# Calculates hash code according to all attributes.
|
142
|
+
# @return [Integer] Hash code
|
143
|
+
def hash
|
144
|
+
[access_token, days_requested].hash
|
145
|
+
end
|
146
|
+
|
147
|
+
# Builds the object from hash
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
# @return [Object] Returns the model itself
|
150
|
+
def self.build_from_hash(attributes)
|
151
|
+
new.build_from_hash(attributes)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Builds the object from hash
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
# @return [Object] Returns the model itself
|
157
|
+
def build_from_hash(attributes)
|
158
|
+
return nil unless attributes.is_a?(Hash)
|
159
|
+
attributes = attributes.transform_keys(&:to_sym)
|
160
|
+
self.class.openapi_types.each_pair do |key, type|
|
161
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
162
|
+
self.send("#{key}=", nil)
|
163
|
+
elsif type =~ /\AArray<(.*)>/i
|
164
|
+
# check to ensure the input is an array given that the attribute
|
165
|
+
# is documented as an array but the input is not
|
166
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
167
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
168
|
+
end
|
169
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
170
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
self
|
175
|
+
end
|
176
|
+
|
177
|
+
# Deserializes the data based on type
|
178
|
+
# @param string type Data type
|
179
|
+
# @param string value Value to be deserialized
|
180
|
+
# @return [Object] Deserialized data
|
181
|
+
def _deserialize(type, value)
|
182
|
+
case type.to_sym
|
183
|
+
when :Time
|
184
|
+
Time.parse(value)
|
185
|
+
when :Date
|
186
|
+
Date.parse(value)
|
187
|
+
when :String
|
188
|
+
value.to_s
|
189
|
+
when :Integer
|
190
|
+
value.to_i
|
191
|
+
when :Float
|
192
|
+
value.to_f
|
193
|
+
when :Boolean
|
194
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
195
|
+
true
|
196
|
+
else
|
197
|
+
false
|
198
|
+
end
|
199
|
+
when :Object
|
200
|
+
# generic object (usually a Hash), return directly
|
201
|
+
value
|
202
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
203
|
+
inner_type = Regexp.last_match[:inner_type]
|
204
|
+
value.map { |v| _deserialize(inner_type, v) }
|
205
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
206
|
+
k_type = Regexp.last_match[:k_type]
|
207
|
+
v_type = Regexp.last_match[:v_type]
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each do |k, v|
|
210
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
else # model
|
214
|
+
# models (e.g. Pet) or oneOf
|
215
|
+
klass = FuseClient.const_get(type)
|
216
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the string representation of the object
|
221
|
+
# @return [String] String presentation of the object
|
222
|
+
def to_s
|
223
|
+
to_hash.to_s
|
224
|
+
end
|
225
|
+
|
226
|
+
# to_body is an alias to to_hash (backward compatibility)
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
228
|
+
def to_body
|
229
|
+
to_hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the object in the form of hash
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_hash
|
235
|
+
hash = {}
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
237
|
+
value = self.send(attr)
|
238
|
+
if value.nil?
|
239
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
240
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
241
|
+
end
|
242
|
+
|
243
|
+
hash[param] = _to_hash(value)
|
244
|
+
end
|
245
|
+
hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Outputs non-array value in the form of hash
|
249
|
+
# For object, use to_hash. Otherwise, just return the value
|
250
|
+
# @param [Object] value Any valid value
|
251
|
+
# @return [Hash] Returns the value in the form of hash
|
252
|
+
def _to_hash(value)
|
253
|
+
if value.is_a?(Array)
|
254
|
+
value.compact.map { |v| _to_hash(v) }
|
255
|
+
elsif value.is_a?(Hash)
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
258
|
+
end
|
259
|
+
elsif value.respond_to? :to_hash
|
260
|
+
value.to_hash
|
261
|
+
else
|
262
|
+
value
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
267
|
+
|
268
|
+
end
|