fuse_client 1.0.37 → 1.0.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/docs/{SpendPower.md → ConsumerRiskReport.md} +5 -5
- data/docs/{SpendPowerCustomization.md → ConsumerRiskReportCustomization.md} +6 -6
- data/docs/{SpendPowerTimeFrame.md → ConsumerRiskReportTimeFrame.md} +2 -2
- data/docs/{CreateSpendPowerCustomizationRequest.md → CreateConsumerRiskReportCustomizationRequest.md} +5 -5
- data/docs/{CreateSpendPowerCustomizationResponse.md → CreateConsumerRiskReportCustomizationResponse.md} +2 -2
- data/docs/CreateConsumerRiskReportRequest.md +24 -0
- data/docs/{DeleteSpendPowerResponse.md → CreateConsumerRiskReportResponse.md} +3 -3
- data/docs/CreateLinkTokenRequest.md +3 -1
- data/docs/CreateLinkTokenRequestSnaptrade.md +18 -0
- data/docs/CreateLinkTokenRequestSnaptradeConfig.md +18 -0
- data/docs/{CreateSpendPowerResponse.md → DeleteConsumerRiskReportResponse.md} +3 -3
- data/docs/EnrichedTransaction.md +4 -26
- data/docs/EvalConsumerRiskReportRequest.md +22 -0
- data/docs/{EvalSpendPowerRequestEventsInner.md → EvalConsumerRiskReportRequestEventsInner.md} +2 -2
- data/docs/{EvalSpendPowerResponse.md → EvalConsumerRiskReportResponse.md} +2 -2
- data/docs/ExternalTransactionEvent.md +8 -2
- data/docs/FinancialConnectionDetails.md +5 -1
- data/docs/FinancialConnectionDetailsBasiq.md +20 -0
- data/docs/FinancialConnectionDetailsBelvo.md +20 -0
- data/docs/FinancialConnectionsAccount.md +2 -0
- data/docs/FinancialConnectionsAccountLiability.md +2 -0
- data/docs/FinancialConnectionsInvestmentSecurityExchange.md +3 -1
- data/docs/FinancialConnectionsOwnerAddressesInnerData.md +2 -0
- data/docs/FuseApi.md +153 -149
- data/docs/{GetSpendPowerCustomizationResponse.md → GetConsumerRiskReportCustomizationResponse.md} +4 -4
- data/docs/{GetSpendPowerResponse.md → GetConsumerRiskReportResponse.md} +4 -4
- data/docs/InAppTransactionEvent.md +1 -1
- data/docs/RiskReportApi.md +165 -0
- data/docs/Transaction.md +1 -1
- data/docs/TransactionToEnrich.md +13 -5
- data/docs/{UpdateSpendPowerCustomizationRequest.md → UpdateConsumerRiskReportCustomizationRequest.md} +5 -5
- data/docs/{UpdateSpendPowerCustomizationResponse.md → UpdateConsumerRiskReportCustomizationResponse.md} +2 -2
- data/docs/UpdatedBalanceEvent.md +2 -2
- data/lib/fuse_client/api/fuse_api.rb +142 -139
- data/lib/fuse_client/api/{spend_power_api.rb → risk_report_api.rb} +39 -39
- data/lib/fuse_client/configuration.rb +5 -1
- data/lib/fuse_client/models/account_subtype.rb +3 -2
- data/lib/fuse_client/models/aggregator.rb +3 -1
- data/lib/fuse_client/models/{spend_power.rb → consumer_risk_report.rb} +4 -6
- data/lib/fuse_client/models/{spend_power_customization.rb → consumer_risk_report_customization.rb} +6 -7
- data/lib/fuse_client/models/{spend_power_time_frame.rb → consumer_risk_report_time_frame.rb} +3 -3
- data/lib/fuse_client/models/{create_spend_power_customization_request.rb → create_consumer_risk_report_customization_request.rb} +6 -6
- data/lib/fuse_client/models/{create_spend_power_customization_response.rb → create_consumer_risk_report_customization_response.rb} +3 -3
- data/lib/fuse_client/models/{create_spend_power_request.rb → create_consumer_risk_report_request.rb} +16 -6
- data/lib/fuse_client/models/{delete_spend_power_response.rb → create_consumer_risk_report_response.rb} +3 -4
- data/lib/fuse_client/models/create_link_token_request.rb +13 -4
- data/lib/fuse_client/models/create_link_token_request_snaptrade.rb +220 -0
- data/lib/fuse_client/models/create_link_token_request_snaptrade_config.rb +256 -0
- data/lib/fuse_client/models/{create_spend_power_response.rb → delete_consumer_risk_report_response.rb} +3 -4
- data/lib/fuse_client/models/enriched_transaction.rb +17 -158
- data/lib/fuse_client/models/{eval_spend_power_request.rb → eval_consumer_risk_report_request.rb} +5 -5
- data/lib/fuse_client/models/{eval_spend_power_request_events_inner.rb → eval_consumer_risk_report_request_events_inner.rb} +3 -3
- data/lib/fuse_client/models/{eval_spend_power_response.rb → eval_consumer_risk_report_response.rb} +3 -3
- data/lib/fuse_client/models/external_transaction_event.rb +45 -7
- data/lib/fuse_client/models/financial_connection_details.rb +22 -4
- data/lib/fuse_client/models/financial_connection_details_basiq.rb +241 -0
- data/lib/fuse_client/models/financial_connection_details_belvo.rb +236 -0
- data/lib/fuse_client/models/financial_connections_account.rb +16 -1
- data/lib/fuse_client/models/financial_connections_account_balance.rb +2 -0
- data/lib/fuse_client/models/financial_connections_account_cached_balance.rb +2 -0
- data/lib/fuse_client/models/financial_connections_account_liability.rb +16 -1
- data/lib/fuse_client/models/financial_connections_investment_security_exchange.rb +14 -4
- data/lib/fuse_client/models/financial_connections_owner_addresses_inner_data.rb +11 -1
- data/lib/fuse_client/models/fuse_api_error_code.rb +6 -3
- data/lib/fuse_client/models/get_consumer_risk_report_customization_response.rb +239 -0
- data/lib/fuse_client/models/{get_spend_power_response.rb → get_consumer_risk_report_response.rb} +13 -13
- data/lib/fuse_client/models/in_app_transaction_event.rb +0 -5
- data/lib/fuse_client/models/transaction.rb +1 -1
- data/lib/fuse_client/models/transaction_to_enrich.rb +130 -27
- data/lib/fuse_client/models/{update_spend_power_customization_request.rb → update_consumer_risk_report_customization_request.rb} +6 -6
- data/lib/fuse_client/models/{update_spend_power_customization_response.rb → update_consumer_risk_report_customization_response.rb} +3 -3
- data/lib/fuse_client/models/updated_balance_event.rb +2 -2
- data/lib/fuse_client/version.rb +1 -1
- data/lib/fuse_client.rb +20 -16
- data/spec/api/fuse_api_spec.rb +37 -36
- data/spec/api/{spend_power_api_spec.rb → risk_report_api_spec.rb} +16 -16
- data/spec/models/asset_report_transaction_spec.rb +1 -1
- data/spec/models/{spend_power_customization_spec.rb → consumer_risk_report_customization_spec.rb} +6 -6
- data/spec/models/{spend_power_spec.rb → consumer_risk_report_spec.rb} +6 -6
- data/spec/models/{spend_power_time_frame_spec.rb → consumer_risk_report_time_frame_spec.rb} +6 -6
- data/spec/models/{create_spend_power_customization_request_spec.rb → create_consumer_risk_report_customization_request_spec.rb} +6 -6
- data/spec/models/{create_spend_power_customization_response_spec.rb → create_consumer_risk_report_customization_response_spec.rb} +6 -6
- data/spec/models/{create_spend_power_request_spec.rb → create_consumer_risk_report_request_spec.rb} +12 -6
- data/spec/models/{delete_spend_power_response_spec.rb → create_consumer_risk_report_response_spec.rb} +6 -6
- data/spec/models/create_link_token_request_snaptrade_config_spec.rb +38 -0
- data/spec/models/create_link_token_request_snaptrade_spec.rb +34 -0
- data/spec/models/create_link_token_request_spec.rb +6 -0
- data/spec/models/{create_spend_power_response_spec.rb → delete_consumer_risk_report_response_spec.rb} +6 -6
- data/spec/models/enriched_transaction_spec.rb +2 -72
- data/spec/models/{eval_spend_power_request_events_inner_spec.rb → eval_consumer_risk_report_request_events_inner_spec.rb} +6 -6
- data/spec/models/{eval_spend_power_request_spec.rb → eval_consumer_risk_report_request_spec.rb} +6 -6
- data/spec/models/{eval_spend_power_response_spec.rb → eval_consumer_risk_report_response_spec.rb} +6 -6
- data/spec/models/external_transaction_event_spec.rb +22 -0
- data/spec/models/financial_connection_details_basiq_spec.rb +40 -0
- data/spec/models/financial_connection_details_belvo_spec.rb +40 -0
- data/spec/models/financial_connection_details_spec.rb +12 -0
- data/spec/models/financial_connections_account_liability_spec.rb +6 -0
- data/spec/models/financial_connections_account_spec.rb +6 -0
- data/spec/models/financial_connections_investment_security_exchange_spec.rb +6 -0
- data/spec/models/financial_connections_owner_addresses_inner_data_spec.rb +6 -0
- data/spec/models/{get_spend_power_customization_response_spec.rb → get_consumer_risk_report_customization_response_spec.rb} +7 -7
- data/spec/models/{get_spend_power_response_spec.rb → get_consumer_risk_report_response_spec.rb} +7 -7
- data/spec/models/transaction_spec.rb +1 -1
- data/spec/models/transaction_to_enrich_spec.rb +32 -4
- data/spec/models/{update_spend_power_customization_request_spec.rb → update_consumer_risk_report_customization_request_spec.rb} +6 -6
- data/spec/models/{update_spend_power_customization_response_spec.rb → update_consumer_risk_report_customization_response_spec.rb} +6 -6
- metadata +92 -76
- data/docs/CreateSpendPowerRequest.md +0 -22
- data/docs/EvalSpendPowerRequest.md +0 -22
- data/docs/SpendPowerApi.md +0 -165
- data/lib/fuse_client/models/get_spend_power_customization_response.rb +0 -239
@@ -422,7 +422,11 @@ module FuseClient
|
|
422
422
|
[
|
423
423
|
{
|
424
424
|
url: "https://sandbox-api.letsfuse.com",
|
425
|
-
description: "sandbox",
|
425
|
+
description: "Fuse sandbox API server",
|
426
|
+
},
|
427
|
+
{
|
428
|
+
url: "https://api.letsfuse.com",
|
429
|
+
description: "Fuse production API server",
|
426
430
|
}
|
427
431
|
]
|
428
432
|
end
|
@@ -37,6 +37,7 @@ module FuseClient
|
|
37
37
|
CONSTRUCTION = "construction".freeze
|
38
38
|
CONSUMER = "consumer".freeze
|
39
39
|
HOME_EQUITY = "home_equity".freeze
|
40
|
+
FOREIGN = "foreign".freeze
|
40
41
|
LOAN = "loan".freeze
|
41
42
|
MORTGAGE = "mortgage".freeze
|
42
43
|
OVERDRAFT = "overdraft".freeze
|
@@ -165,10 +166,10 @@ module FuseClient
|
|
165
166
|
REVOLVING = "revolving".freeze
|
166
167
|
OTHER = "other".freeze
|
167
168
|
TIME_DEPOSIT = "time_deposit".freeze
|
168
|
-
|
169
|
+
UNMAPPED = "-".freeze
|
169
170
|
|
170
171
|
def self.all_vars
|
171
|
-
@all_vars ||= [CHECKING, SAVINGS, CHECKING_OR_SAVINGS, BUSINESS_CHECKING_OR_SAVINGS, BUSINESS_SAVINGS, MONEY_MARKET, CERTIFICATE_OF_DEPOSIT, TREASURY, CREDIT_CARD, DEBIT_CARD, BONDS, HSA, PAYPAL, PREPAID, CASH_MANAGEMENT, EBT, AUTO, BUSINESS, COMMERCIAL, CONSTRUCTION, CONSUMER, HOME_EQUITY, LOAN, MORTGAGE, OVERDRAFT, LINE_OF_CREDIT, STUDENT, N529, N401_A, N401_K, N403_B, N457_B, FUNDS, BROKERAGE, SECURITIES, STOCKS, CASH_ISA, CRYPTO_EXCHANGE, EDUCATION_SAVING_ACCOUNT, FIXED_ANNUITY, GIC, HEALTH_REIMBURSEMENT_ARRANGEMENT, IRA, ISA, KEOGH, LIF, LIFE_INSURANCE, LIRA, LRIF, LRSP, MUTUAL_FUND, NON_CUSTODIAL_WALLET, NON_TAXABLE_BROKERAGE_ACCOUNT, OTHER_ANNUITY, OTHER_INSURANCE, PENSION, PRIF, PROFIT_SHARING_PLAN, QSHR, RDSP, RESP, RETIREMENT, RLIF, ROTH_IRA, ROTH_401_K, RRIF, RRSP, SARSEP, SEP_IRA, SIMPLE_IRA, SIPP, STOCK_PLAN, TFSA, TRUST, UGMA, UTMA, VARIABLE_ANNUITY, SMALL_BUSINESS, PERSONAL, PERSONAL_WITH_COLLATERAL, N457, ROLLOVER_IRA, TAXABLE, NON_TAXABLE, EMPLOYEE_STOCK_OWNERSHIP_PLAN, INDIVIDUAL, CASH_MANAGEMENT_ACCOUNT, EMPLOYEE_STOCK_PURCHASE_PLAN, REGISTERED_EDUCATION_SAVINGS_PLAN, FIXED_ANNUITY_TRADITIONAL_IRA, INHERITED_TRADITIONAL_IRA, FIXED_ANNUITY_ROTH_IRA, VARIABLE_ANNUITY_ROTH_IRA, INHERITED_ROTH_IRA, ADVISORY_ACCOUNT, BROKERAGE_MARGIN, CHARITABLE_GIFT_ACCOUNT, CHURCH_ACCOUNT, CONSERVATORSHIP, CUSTODIAL, DEFINED_BENEFIT_PLAN, DEFINED_CONTRIBUTION_PLAN, EDUCATIONAL, ESTATE, EXECUTOR, GROUP_RETIREMENT_SAVINGS_PLAN, GUARANTEED_INVESTMENT_CERTIFICATE, INDEXED_ANNUITY, INVESTMENT_CLUB, IRREVOCABLE_TRUST, JOINT_TENANTS_BY_ENTIRETY, JOINT_TENANTS_COMMUNITY_PROPERTY, JOINT_TENANTS_IN_COMMON, JOINT_TENANTS_WITH_RIGHTS_OF_SURVIVORSHIP, KEOUGH_PLAN, LIVING_TRUST, LOCKED_IN_RETIREMENT_ACCOUNT, LOCKED_IN_RETIREMENT_INVESTMENT_FUND, LOCKED_IN_RETIREMENT_SAVINGS_ACCOUNT, MONEY_PURCHASE_PLAN, PARTNERSHIP, N409_A, RPP, REVOCABLE_TRUST, ROTH_CONVERSION, SOLE_PROPRIETORSHIP, SPOUSAL_IRA, SPOUSAL_ROTH_IRA, TESTAMENTARY_TRUST, THRIFT_SAVINGS_PLAN, INHERITED_ANNUITY, CORPORATE_ACCOUNT, LIMITED_LIABILITY_ACCOUNT, BOAT, POWERSPORTS, RV, HELOC, VEHICLE_INSURANCE, DISABILITY, HEALTH, LONG_TERM_CARE, PROPERTY_AND_CASUALTY, UNIVERSAL_LIFE, TERM_LIFE, WHOLE_LIFE, ACCIDENTAL_DEATH_AND_DISMEMBERMENT, VARIABLE_UNIVERSAL_LIFE, REVOLVING, OTHER, TIME_DEPOSIT, ].freeze
|
172
|
+
@all_vars ||= [CHECKING, SAVINGS, CHECKING_OR_SAVINGS, BUSINESS_CHECKING_OR_SAVINGS, BUSINESS_SAVINGS, MONEY_MARKET, CERTIFICATE_OF_DEPOSIT, TREASURY, CREDIT_CARD, DEBIT_CARD, BONDS, HSA, PAYPAL, PREPAID, CASH_MANAGEMENT, EBT, AUTO, BUSINESS, COMMERCIAL, CONSTRUCTION, CONSUMER, HOME_EQUITY, FOREIGN, LOAN, MORTGAGE, OVERDRAFT, LINE_OF_CREDIT, STUDENT, N529, N401_A, N401_K, N403_B, N457_B, FUNDS, BROKERAGE, SECURITIES, STOCKS, CASH_ISA, CRYPTO_EXCHANGE, EDUCATION_SAVING_ACCOUNT, FIXED_ANNUITY, GIC, HEALTH_REIMBURSEMENT_ARRANGEMENT, IRA, ISA, KEOGH, LIF, LIFE_INSURANCE, LIRA, LRIF, LRSP, MUTUAL_FUND, NON_CUSTODIAL_WALLET, NON_TAXABLE_BROKERAGE_ACCOUNT, OTHER_ANNUITY, OTHER_INSURANCE, PENSION, PRIF, PROFIT_SHARING_PLAN, QSHR, RDSP, RESP, RETIREMENT, RLIF, ROTH_IRA, ROTH_401_K, RRIF, RRSP, SARSEP, SEP_IRA, SIMPLE_IRA, SIPP, STOCK_PLAN, TFSA, TRUST, UGMA, UTMA, VARIABLE_ANNUITY, SMALL_BUSINESS, PERSONAL, PERSONAL_WITH_COLLATERAL, N457, ROLLOVER_IRA, TAXABLE, NON_TAXABLE, EMPLOYEE_STOCK_OWNERSHIP_PLAN, INDIVIDUAL, CASH_MANAGEMENT_ACCOUNT, EMPLOYEE_STOCK_PURCHASE_PLAN, REGISTERED_EDUCATION_SAVINGS_PLAN, FIXED_ANNUITY_TRADITIONAL_IRA, INHERITED_TRADITIONAL_IRA, FIXED_ANNUITY_ROTH_IRA, VARIABLE_ANNUITY_ROTH_IRA, INHERITED_ROTH_IRA, ADVISORY_ACCOUNT, BROKERAGE_MARGIN, CHARITABLE_GIFT_ACCOUNT, CHURCH_ACCOUNT, CONSERVATORSHIP, CUSTODIAL, DEFINED_BENEFIT_PLAN, DEFINED_CONTRIBUTION_PLAN, EDUCATIONAL, ESTATE, EXECUTOR, GROUP_RETIREMENT_SAVINGS_PLAN, GUARANTEED_INVESTMENT_CERTIFICATE, INDEXED_ANNUITY, INVESTMENT_CLUB, IRREVOCABLE_TRUST, JOINT_TENANTS_BY_ENTIRETY, JOINT_TENANTS_COMMUNITY_PROPERTY, JOINT_TENANTS_IN_COMMON, JOINT_TENANTS_WITH_RIGHTS_OF_SURVIVORSHIP, KEOUGH_PLAN, LIVING_TRUST, LOCKED_IN_RETIREMENT_ACCOUNT, LOCKED_IN_RETIREMENT_INVESTMENT_FUND, LOCKED_IN_RETIREMENT_SAVINGS_ACCOUNT, MONEY_PURCHASE_PLAN, PARTNERSHIP, N409_A, RPP, REVOCABLE_TRUST, ROTH_CONVERSION, SOLE_PROPRIETORSHIP, SPOUSAL_IRA, SPOUSAL_ROTH_IRA, TESTAMENTARY_TRUST, THRIFT_SAVINGS_PLAN, INHERITED_ANNUITY, CORPORATE_ACCOUNT, LIMITED_LIABILITY_ACCOUNT, BOAT, POWERSPORTS, RV, HELOC, VEHICLE_INSURANCE, DISABILITY, HEALTH, LONG_TERM_CARE, PROPERTY_AND_CASUALTY, UNIVERSAL_LIFE, TERM_LIFE, WHOLE_LIFE, ACCIDENTAL_DEATH_AND_DISMEMBERMENT, VARIABLE_UNIVERSAL_LIFE, REVOLVING, OTHER, TIME_DEPOSIT, ].freeze
|
172
173
|
end
|
173
174
|
|
174
175
|
# Builds the enum from string
|
@@ -23,9 +23,11 @@ module FuseClient
|
|
23
23
|
MONO = "mono".freeze
|
24
24
|
TRUELAYER = "truelayer".freeze
|
25
25
|
FINVERSE = "finverse".freeze
|
26
|
+
BASIQ = "basiq".freeze
|
27
|
+
BELVO = "belvo".freeze
|
26
28
|
|
27
29
|
def self.all_vars
|
28
|
-
@all_vars ||= [PLAID, TELLER, MX, SNAPTRADE, FLINKS, MONO, TRUELAYER, FINVERSE].freeze
|
30
|
+
@all_vars ||= [PLAID, TELLER, MX, SNAPTRADE, FLINKS, MONO, TRUELAYER, FINVERSE, BASIQ, BELVO].freeze
|
29
31
|
end
|
30
32
|
|
31
33
|
# Builds the enum from string
|
@@ -14,11 +14,9 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
18
|
-
# The id of the spend power
|
17
|
+
class ConsumerRiskReport
|
19
18
|
attr_accessor :id
|
20
19
|
|
21
|
-
# The customization id of the spend power.
|
22
20
|
attr_accessor :customization_id
|
23
21
|
|
24
22
|
# The total limit for the current timeframe, in cents.
|
@@ -33,7 +31,7 @@ module FuseClient
|
|
33
31
|
# The ISO-4217 currency code of the transaction
|
34
32
|
attr_accessor :iso_currency_code
|
35
33
|
|
36
|
-
# The datetime of when the
|
34
|
+
# The datetime of when the consumer risk report was most recently updated, in ISO-8601 format.
|
37
35
|
attr_accessor :last_updated
|
38
36
|
|
39
37
|
attr_accessor :finance_score
|
@@ -86,13 +84,13 @@ module FuseClient
|
|
86
84
|
# @param [Hash] attributes Model attributes in the form of hash
|
87
85
|
def initialize(attributes = {})
|
88
86
|
if (!attributes.is_a?(Hash))
|
89
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::ConsumerRiskReport` initialize method"
|
90
88
|
end
|
91
89
|
|
92
90
|
# check to see if the attribute exists and convert string to symbol for hash key
|
93
91
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
94
92
|
if (!self.class.attribute_map.key?(k.to_sym))
|
95
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::ConsumerRiskReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
96
94
|
end
|
97
95
|
h[k.to_sym] = v
|
98
96
|
}
|
data/lib/fuse_client/models/{spend_power_customization.rb → consumer_risk_report_customization.rb}
RENAMED
@@ -14,16 +14,15 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
18
|
-
# The id of the spend power customization
|
17
|
+
class ConsumerRiskReportCustomization
|
19
18
|
attr_accessor :id
|
20
19
|
|
21
20
|
attr_accessor :timeframe
|
22
21
|
|
23
|
-
# The minimum allowed limit
|
22
|
+
# The minimum allowed limit, in cents.
|
24
23
|
attr_accessor :min_limit
|
25
24
|
|
26
|
-
# The maximum allowed limit
|
25
|
+
# The maximum allowed limit, in cents.
|
27
26
|
attr_accessor :max_limit
|
28
27
|
|
29
28
|
# This parameter indicates the risk tolerance associated with spend limits. A high risk tolerance allow for higher limits, increasing both potential gains and losses. A Lower risk tolerance enforces strict limits, reducing the potential for loss but also limiting transaction volume for reliable users.
|
@@ -71,7 +70,7 @@ module FuseClient
|
|
71
70
|
def self.openapi_types
|
72
71
|
{
|
73
72
|
:'id' => :'String',
|
74
|
-
:'timeframe' => :'
|
73
|
+
:'timeframe' => :'ConsumerRiskReportTimeFrame',
|
75
74
|
:'min_limit' => :'Integer',
|
76
75
|
:'max_limit' => :'Integer',
|
77
76
|
:'risk_tolerance' => :'Integer'
|
@@ -88,13 +87,13 @@ module FuseClient
|
|
88
87
|
# @param [Hash] attributes Model attributes in the form of hash
|
89
88
|
def initialize(attributes = {})
|
90
89
|
if (!attributes.is_a?(Hash))
|
91
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::ConsumerRiskReportCustomization` initialize method"
|
92
91
|
end
|
93
92
|
|
94
93
|
# check to see if the attribute exists and convert string to symbol for hash key
|
95
94
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
96
95
|
if (!self.class.attribute_map.key?(k.to_sym))
|
97
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::ConsumerRiskReportCustomization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
98
97
|
end
|
99
98
|
h[k.to_sym] = v
|
100
99
|
}
|
data/lib/fuse_client/models/{spend_power_time_frame.rb → consumer_risk_report_time_frame.rb}
RENAMED
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
17
|
+
class ConsumerRiskReportTimeFrame
|
18
18
|
DAILY = "daily".freeze
|
19
19
|
WEEKLY = "weekly".freeze
|
20
20
|
MONTHLY = "monthly".freeze
|
@@ -34,8 +34,8 @@ module FuseClient
|
|
34
34
|
# @param [String] The enum value in the form of the string
|
35
35
|
# @return [String] The enum value
|
36
36
|
def build_from_hash(value)
|
37
|
-
return value if
|
38
|
-
raise "Invalid ENUM value #{value} for class #
|
37
|
+
return value if ConsumerRiskReportTimeFrame.all_vars.include?(value)
|
38
|
+
raise "Invalid ENUM value #{value} for class #ConsumerRiskReportTimeFrame"
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -14,13 +14,13 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
17
|
+
class CreateConsumerRiskReportCustomizationRequest
|
18
18
|
attr_accessor :timeframe
|
19
19
|
|
20
|
-
# The minimum allowed limit
|
20
|
+
# The minimum allowed limit, in cents.
|
21
21
|
attr_accessor :min_limit
|
22
22
|
|
23
|
-
# The maximum allowed limit
|
23
|
+
# The maximum allowed limit, in cents.
|
24
24
|
attr_accessor :max_limit
|
25
25
|
|
26
26
|
# This parameter indicates the risk tolerance associated with spend limits. A high risk tolerance allow for higher limits, increasing both potential gains and losses. A Lower risk tolerance enforces strict limits, reducing the potential for loss but also limiting transaction volume for reliable users.
|
@@ -66,7 +66,7 @@ module FuseClient
|
|
66
66
|
# Attribute type mapping.
|
67
67
|
def self.openapi_types
|
68
68
|
{
|
69
|
-
:'timeframe' => :'
|
69
|
+
:'timeframe' => :'ConsumerRiskReportTimeFrame',
|
70
70
|
:'min_limit' => :'Float',
|
71
71
|
:'max_limit' => :'Float',
|
72
72
|
:'risk_tolerance' => :'Float'
|
@@ -83,13 +83,13 @@ module FuseClient
|
|
83
83
|
# @param [Hash] attributes Model attributes in the form of hash
|
84
84
|
def initialize(attributes = {})
|
85
85
|
if (!attributes.is_a?(Hash))
|
86
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateConsumerRiskReportCustomizationRequest` initialize method"
|
87
87
|
end
|
88
88
|
|
89
89
|
# check to see if the attribute exists and convert string to symbol for hash key
|
90
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
91
|
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateConsumerRiskReportCustomizationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
93
|
end
|
94
94
|
h[k.to_sym] = v
|
95
95
|
}
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
17
|
+
class CreateConsumerRiskReportCustomizationResponse
|
18
18
|
# The id of the created customization.
|
19
19
|
attr_accessor :id
|
20
20
|
|
@@ -52,13 +52,13 @@ module FuseClient
|
|
52
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
53
53
|
def initialize(attributes = {})
|
54
54
|
if (!attributes.is_a?(Hash))
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateConsumerRiskReportCustomizationResponse` initialize method"
|
56
56
|
end
|
57
57
|
|
58
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
59
59
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
60
|
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateConsumerRiskReportCustomizationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
62
|
end
|
63
63
|
h[k.to_sym] = v
|
64
64
|
}
|
data/lib/fuse_client/models/{create_spend_power_request.rb → create_consumer_risk_report_request.rb}
RENAMED
@@ -14,14 +14,17 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
18
|
-
# A unique ID representing the bank account that this
|
17
|
+
class CreateConsumerRiskReportRequest
|
18
|
+
# A unique ID representing the bank account that this risk report is calculated for. Typically this will be a bank connection account ID from your application. It is currently used as a means of connecting events to the consumer risk report.
|
19
19
|
attr_accessor :account_id
|
20
20
|
|
21
21
|
# The ISO-4217 currency code of the transaction
|
22
22
|
attr_accessor :iso_currency_code
|
23
23
|
|
24
|
-
# The
|
24
|
+
# The name of the end user associated with this consumer risk report.
|
25
|
+
attr_accessor :end_user_name
|
26
|
+
|
27
|
+
# This is used to determine the timeframe and other metadata for the consumer risk report.
|
25
28
|
attr_accessor :customization_id
|
26
29
|
|
27
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -29,6 +32,7 @@ module FuseClient
|
|
29
32
|
{
|
30
33
|
:'account_id' => :'account_id',
|
31
34
|
:'iso_currency_code' => :'iso_currency_code',
|
35
|
+
:'end_user_name' => :'end_user_name',
|
32
36
|
:'customization_id' => :'customization_id'
|
33
37
|
}
|
34
38
|
end
|
@@ -43,6 +47,7 @@ module FuseClient
|
|
43
47
|
{
|
44
48
|
:'account_id' => :'String',
|
45
49
|
:'iso_currency_code' => :'String',
|
50
|
+
:'end_user_name' => :'String',
|
46
51
|
:'customization_id' => :'String'
|
47
52
|
}
|
48
53
|
end
|
@@ -57,13 +62,13 @@ module FuseClient
|
|
57
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
58
63
|
def initialize(attributes = {})
|
59
64
|
if (!attributes.is_a?(Hash))
|
60
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateConsumerRiskReportRequest` initialize method"
|
61
66
|
end
|
62
67
|
|
63
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
64
69
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateConsumerRiskReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
72
|
end
|
68
73
|
h[k.to_sym] = v
|
69
74
|
}
|
@@ -76,6 +81,10 @@ module FuseClient
|
|
76
81
|
self.iso_currency_code = attributes[:'iso_currency_code']
|
77
82
|
end
|
78
83
|
|
84
|
+
if attributes.key?(:'end_user_name')
|
85
|
+
self.end_user_name = attributes[:'end_user_name']
|
86
|
+
end
|
87
|
+
|
79
88
|
if attributes.key?(:'customization_id')
|
80
89
|
self.customization_id = attributes[:'customization_id']
|
81
90
|
end
|
@@ -116,6 +125,7 @@ module FuseClient
|
|
116
125
|
self.class == o.class &&
|
117
126
|
account_id == o.account_id &&
|
118
127
|
iso_currency_code == o.iso_currency_code &&
|
128
|
+
end_user_name == o.end_user_name &&
|
119
129
|
customization_id == o.customization_id
|
120
130
|
end
|
121
131
|
|
@@ -128,7 +138,7 @@ module FuseClient
|
|
128
138
|
# Calculates hash code according to all attributes.
|
129
139
|
# @return [Integer] Hash code
|
130
140
|
def hash
|
131
|
-
[account_id, iso_currency_code, customization_id].hash
|
141
|
+
[account_id, iso_currency_code, end_user_name, customization_id].hash
|
132
142
|
end
|
133
143
|
|
134
144
|
# Builds the object from hash
|
@@ -14,8 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module FuseClient
|
17
|
-
class
|
18
|
-
# The id of the deleted spend power
|
17
|
+
class CreateConsumerRiskReportResponse
|
19
18
|
attr_accessor :id
|
20
19
|
|
21
20
|
# An identifier that is exclusive to the request and can serve as a means for investigating and resolving issues.
|
@@ -52,13 +51,13 @@ module FuseClient
|
|
52
51
|
# @param [Hash] attributes Model attributes in the form of hash
|
53
52
|
def initialize(attributes = {})
|
54
53
|
if (!attributes.is_a?(Hash))
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateConsumerRiskReportResponse` initialize method"
|
56
55
|
end
|
57
56
|
|
58
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
59
58
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
59
|
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateConsumerRiskReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
61
|
end
|
63
62
|
h[k.to_sym] = v
|
64
63
|
}
|
@@ -35,6 +35,8 @@ module FuseClient
|
|
35
35
|
|
36
36
|
attr_accessor :teller
|
37
37
|
|
38
|
+
attr_accessor :snaptrade
|
39
|
+
|
38
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
39
41
|
def self.attribute_map
|
40
42
|
{
|
@@ -45,7 +47,8 @@ module FuseClient
|
|
45
47
|
:'webhook_url' => :'webhook_url',
|
46
48
|
:'mx' => :'mx',
|
47
49
|
:'plaid' => :'plaid',
|
48
|
-
:'teller' => :'teller'
|
50
|
+
:'teller' => :'teller',
|
51
|
+
:'snaptrade' => :'snaptrade'
|
49
52
|
}
|
50
53
|
end
|
51
54
|
|
@@ -64,7 +67,8 @@ module FuseClient
|
|
64
67
|
:'webhook_url' => :'String',
|
65
68
|
:'mx' => :'CreateLinkTokenRequestMx',
|
66
69
|
:'plaid' => :'CreateLinkTokenRequestPlaid',
|
67
|
-
:'teller' => :'CreateLinkTokenRequestTeller'
|
70
|
+
:'teller' => :'CreateLinkTokenRequestTeller',
|
71
|
+
:'snaptrade' => :'CreateLinkTokenRequestSnaptrade'
|
68
72
|
}
|
69
73
|
end
|
70
74
|
|
@@ -120,6 +124,10 @@ module FuseClient
|
|
120
124
|
if attributes.key?(:'teller')
|
121
125
|
self.teller = attributes[:'teller']
|
122
126
|
end
|
127
|
+
|
128
|
+
if attributes.key?(:'snaptrade')
|
129
|
+
self.snaptrade = attributes[:'snaptrade']
|
130
|
+
end
|
123
131
|
end
|
124
132
|
|
125
133
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -167,7 +175,8 @@ module FuseClient
|
|
167
175
|
webhook_url == o.webhook_url &&
|
168
176
|
mx == o.mx &&
|
169
177
|
plaid == o.plaid &&
|
170
|
-
teller == o.teller
|
178
|
+
teller == o.teller &&
|
179
|
+
snaptrade == o.snaptrade
|
171
180
|
end
|
172
181
|
|
173
182
|
# @see the `==` method
|
@@ -179,7 +188,7 @@ module FuseClient
|
|
179
188
|
# Calculates hash code according to all attributes.
|
180
189
|
# @return [Integer] Hash code
|
181
190
|
def hash
|
182
|
-
[institution_id, entity, client_name, session_client_secret, webhook_url, mx, plaid, teller].hash
|
191
|
+
[institution_id, entity, client_name, session_client_secret, webhook_url, mx, plaid, teller, snaptrade].hash
|
183
192
|
end
|
184
193
|
|
185
194
|
# Builds the object from hash
|
@@ -0,0 +1,220 @@
|
|
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.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module FuseClient
|
17
|
+
# An object specifying information about the SnapTrade configuration to use when creating a link token.
|
18
|
+
class CreateLinkTokenRequestSnaptrade
|
19
|
+
attr_accessor :config
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'config' => :'config'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'config' => :'CreateLinkTokenRequestSnaptradeConfig'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FuseClient::CreateLinkTokenRequestSnaptrade` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FuseClient::CreateLinkTokenRequestSnaptrade`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'config')
|
62
|
+
self.config = attributes[:'config']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
invalid_properties
|
71
|
+
end
|
72
|
+
|
73
|
+
# Check to see if the all the properties in the model are valid
|
74
|
+
# @return true if the model is valid
|
75
|
+
def valid?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
# Checks equality by comparing each attribute.
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def ==(o)
|
82
|
+
return true if self.equal?(o)
|
83
|
+
self.class == o.class &&
|
84
|
+
config == o.config
|
85
|
+
end
|
86
|
+
|
87
|
+
# @see the `==` method
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def eql?(o)
|
90
|
+
self == o
|
91
|
+
end
|
92
|
+
|
93
|
+
# Calculates hash code according to all attributes.
|
94
|
+
# @return [Integer] Hash code
|
95
|
+
def hash
|
96
|
+
[config].hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Builds the object from hash
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @return [Object] Returns the model itself
|
102
|
+
def self.build_from_hash(attributes)
|
103
|
+
new.build_from_hash(attributes)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
attributes = attributes.transform_keys(&:to_sym)
|
112
|
+
self.class.openapi_types.each_pair do |key, type|
|
113
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
114
|
+
self.send("#{key}=", nil)
|
115
|
+
elsif type =~ /\AArray<(.*)>/i
|
116
|
+
# check to ensure the input is an array given that the attribute
|
117
|
+
# is documented as an array but the input is not
|
118
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
119
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
120
|
+
end
|
121
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
122
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :Time
|
136
|
+
Time.parse(value)
|
137
|
+
when :Date
|
138
|
+
Date.parse(value)
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :Boolean
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
|
+
true
|
148
|
+
else
|
149
|
+
false
|
150
|
+
end
|
151
|
+
when :Object
|
152
|
+
# generic object (usually a Hash), return directly
|
153
|
+
value
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
160
|
+
{}.tap do |hash|
|
161
|
+
value.each do |k, v|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
else # model
|
166
|
+
# models (e.g. Pet) or oneOf
|
167
|
+
klass = FuseClient.const_get(type)
|
168
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
# @return [String] String presentation of the object
|
174
|
+
def to_s
|
175
|
+
to_hash.to_s
|
176
|
+
end
|
177
|
+
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_body
|
181
|
+
to_hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the object in the form of hash
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_hash
|
187
|
+
hash = {}
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
189
|
+
value = self.send(attr)
|
190
|
+
if value.nil?
|
191
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
192
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
193
|
+
end
|
194
|
+
|
195
|
+
hash[param] = _to_hash(value)
|
196
|
+
end
|
197
|
+
hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Outputs non-array value in the form of hash
|
201
|
+
# For object, use to_hash. Otherwise, just return the value
|
202
|
+
# @param [Object] value Any valid value
|
203
|
+
# @return [Hash] Returns the value in the form of hash
|
204
|
+
def _to_hash(value)
|
205
|
+
if value.is_a?(Array)
|
206
|
+
value.compact.map { |v| _to_hash(v) }
|
207
|
+
elsif value.is_a?(Hash)
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
210
|
+
end
|
211
|
+
elsif value.respond_to? :to_hash
|
212
|
+
value.to_hash
|
213
|
+
else
|
214
|
+
value
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|