hydrogen-proton-api 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +82 -0
- data/Rakefile +8 -0
- data/git_push.sh +55 -0
- data/lib/proton_api.rb +141 -0
- data/lib/proton_api/api/annuities_api.rb +347 -0
- data/lib/proton_api/api/business_financial_management_api.rb +293 -0
- data/lib/proton_api/api/cards_api.rb +185 -0
- data/lib/proton_api/api/financial_health_api.rb +239 -0
- data/lib/proton_api/api/financial_planning_api.rb +671 -0
- data/lib/proton_api/api/goals_api.rb +347 -0
- data/lib/proton_api/api/life_insurance_api.rb +77 -0
- data/lib/proton_api/api/personal_financial_management_api.rb +347 -0
- data/lib/proton_api/api/portfolio_construction_api.rb +77 -0
- data/lib/proton_api/api/portfolio_management_api.rb +77 -0
- data/lib/proton_api/api/risk_scoring_api.rb +185 -0
- data/lib/proton_api/api/simulations_api.rb +401 -0
- data/lib/proton_api/api/util_api.rb +185 -0
- data/lib/proton_api/api_client.rb +391 -0
- data/lib/proton_api/api_error.rb +38 -0
- data/lib/proton_api/auth_configuration.rb +181 -0
- data/lib/proton_api/configuration.rb +209 -0
- data/lib/proton_api/environment.rb +36 -0
- data/lib/proton_api/models/accumulation_goal_deposit_config.rb +338 -0
- data/lib/proton_api/models/annuity_calculator_accumulation_horizon_request.rb +459 -0
- data/lib/proton_api/models/annuity_calculator_annuity_amount_request.rb +461 -0
- data/lib/proton_api/models/annuity_calculator_decumulation_horizon_request.rb +459 -0
- data/lib/proton_api/models/annuity_calculator_deposit_amount_request.rb +468 -0
- data/lib/proton_api/models/annuity_calculator_initial_balance_request.rb +468 -0
- data/lib/proton_api/models/annuity_deposit_schedule.rb +254 -0
- data/lib/proton_api/models/answer.rb +186 -0
- data/lib/proton_api/models/backtest_request.rb +295 -0
- data/lib/proton_api/models/beneficiary_bequest_config.rb +257 -0
- data/lib/proton_api/models/budget_aggregation_account.rb +186 -0
- data/lib/proton_api/models/budget_calculator_request.rb +334 -0
- data/lib/proton_api/models/budget_component.rb +228 -0
- data/lib/proton_api/models/budget_details.rb +337 -0
- data/lib/proton_api/models/business_financial_health_check_request.rb +484 -0
- data/lib/proton_api/models/business_invoice_analysis_request.rb +361 -0
- data/lib/proton_api/models/calculator_deposit_schedule.rb +228 -0
- data/lib/proton_api/models/calculator_deposit_schedule1.rb +254 -0
- data/lib/proton_api/models/card_analysis_request.rb +372 -0
- data/lib/proton_api/models/card_limit_check_request.rb +231 -0
- data/lib/proton_api/models/card_transaction_authorization_request.rb +422 -0
- data/lib/proton_api/models/cash_analysis_request.rb +340 -0
- data/lib/proton_api/models/cash_flow_analysis_request.rb +366 -0
- data/lib/proton_api/models/children_education_config.rb +221 -0
- data/lib/proton_api/models/customer_analysis_request.rb +292 -0
- data/lib/proton_api/models/decision_tree_result_request.rb +236 -0
- data/lib/proton_api/models/decumulation_goal_deposit_config.rb +335 -0
- data/lib/proton_api/models/dimensional_risk_score_request.rb +282 -0
- data/lib/proton_api/models/diversification_score_request.rb +324 -0
- data/lib/proton_api/models/education_calculator_annual_cost_request.rb +450 -0
- data/lib/proton_api/models/education_calculator_deposit_amount_request.rb +483 -0
- data/lib/proton_api/models/education_calculator_percent_covered_request.rb +448 -0
- data/lib/proton_api/models/education_config.rb +271 -0
- data/lib/proton_api/models/emergency_fund_calculator_request.rb +561 -0
- data/lib/proton_api/models/event_study_request.rb +317 -0
- data/lib/proton_api/models/fee_analysis_request.rb +239 -0
- data/lib/proton_api/models/financial_health_check_request.rb +384 -0
- data/lib/proton_api/models/financial_picture_request.rb +270 -0
- data/lib/proton_api/models/financial_statement_analysis_request.rb +461 -0
- data/lib/proton_api/models/goal_accumulation_allocation_request.rb +729 -0
- data/lib/proton_api/models/goal_accumulation_recommendation_request.rb +622 -0
- data/lib/proton_api/models/goal_accumulation_status_request.rb +622 -0
- data/lib/proton_api/models/goal_config.rb +222 -0
- data/lib/proton_api/models/goal_decumulation_allocation_request.rb +764 -0
- data/lib/proton_api/models/goal_decumulation_recommendation_request.rb +657 -0
- data/lib/proton_api/models/goal_decumulation_status_request.rb +657 -0
- data/lib/proton_api/models/goal_withdrawal_config.rb +335 -0
- data/lib/proton_api/models/guaranteed_rate_benefit.rb +272 -0
- data/lib/proton_api/models/income_config.rb +266 -0
- data/lib/proton_api/models/life_insurance_needs_calculator_request.rb +515 -0
- data/lib/proton_api/models/location.rb +183 -0
- data/lib/proton_api/models/monte_carlo_request.rb +504 -0
- data/lib/proton_api/models/mortgage_calculator_down_payment_request.rb +299 -0
- data/lib/proton_api/models/mortgage_calculator_home_price_request.rb +299 -0
- data/lib/proton_api/models/mortgage_calculator_periodic_payment_request.rb +299 -0
- data/lib/proton_api/models/mvo_request.rb +366 -0
- data/lib/proton_api/models/opt_config.rb +300 -0
- data/lib/proton_api/models/opt_config1.rb +260 -0
- data/lib/proton_api/models/order_rebalance_request.rb +398 -0
- data/lib/proton_api/models/performance_calculator_request.rb +687 -0
- data/lib/proton_api/models/periods.rb +220 -0
- data/lib/proton_api/models/portfolio_optimization_score_request.rb +356 -0
- data/lib/proton_api/models/portfolio_what_if_request.rb +351 -0
- data/lib/proton_api/models/purchase_calculator_amount_request.rb +401 -0
- data/lib/proton_api/models/purchase_calculator_deposit_amount_request.rb +434 -0
- data/lib/proton_api/models/purchase_calculator_horizon_request.rb +356 -0
- data/lib/proton_api/models/ratio_targets.rb +328 -0
- data/lib/proton_api/models/ratio_targets1.rb +328 -0
- data/lib/proton_api/models/rebalancing_signal_request.rb +238 -0
- data/lib/proton_api/models/recommendation_config.rb +357 -0
- data/lib/proton_api/models/recommendation_config1.rb +346 -0
- data/lib/proton_api/models/recurring_transaction_analysis_request.rb +400 -0
- data/lib/proton_api/models/retirement_calculator_deposit_amount_request.rb +509 -0
- data/lib/proton_api/models/retirement_calculator_expenses_request.rb +476 -0
- data/lib/proton_api/models/retirement_calculator_percent_covered_request.rb +474 -0
- data/lib/proton_api/models/risk_allocation_request.rb +316 -0
- data/lib/proton_api/models/risk_score_request.rb +239 -0
- data/lib/proton_api/models/savings_calculator_request.rb +395 -0
- data/lib/proton_api/models/savings_deposit_schedule.rb +276 -0
- data/lib/proton_api/models/scenario_analysis_request.rb +401 -0
- data/lib/proton_api/models/sensitivity_analysis_request.rb +399 -0
- data/lib/proton_api/models/sensitivity_factor.rb +278 -0
- data/lib/proton_api/models/settings.rb +287 -0
- data/lib/proton_api/models/spending_analysis_request.rb +505 -0
- data/lib/proton_api/models/variable_annuity_request.rb +700 -0
- data/lib/proton_api/models/w_config.rb +382 -0
- data/lib/proton_api/models/w_config1.rb +347 -0
- data/lib/proton_api/version.rb +15 -0
- data/proton_api.gemspec +46 -0
- data/spec/api/annuities_api_spec.rb +107 -0
- data/spec/api/business_financial_management_api_spec.rb +95 -0
- data/spec/api/cards_api_spec.rb +71 -0
- data/spec/api/financial_health_api_spec.rb +83 -0
- data/spec/api/financial_planning_api_spec.rb +179 -0
- data/spec/api/goals_api_spec.rb +107 -0
- data/spec/api/life_insurance_api_spec.rb +47 -0
- data/spec/api/personal_financial_management_api_spec.rb +107 -0
- data/spec/api/portfolio_construction_api_spec.rb +47 -0
- data/spec/api/portfolio_management_api_spec.rb +47 -0
- data/spec/api/risk_scoring_api_spec.rb +71 -0
- data/spec/api/simulations_api_spec.rb +119 -0
- data/spec/api/util_api_spec.rb +71 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/accumulation_goal_deposit_config_spec.rb +89 -0
- data/spec/models/annuity_calculator_accumulation_horizon_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_annuity_amount_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_decumulation_horizon_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_deposit_amount_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_initial_balance_request_spec.rb +111 -0
- data/spec/models/annuity_deposit_schedule_spec.rb +57 -0
- data/spec/models/answer_spec.rb +41 -0
- data/spec/models/backtest_request_spec.rb +95 -0
- data/spec/models/beneficiary_bequest_config_spec.rb +53 -0
- data/spec/models/budget_aggregation_account_spec.rb +41 -0
- data/spec/models/budget_calculator_request_spec.rb +105 -0
- data/spec/models/budget_component_spec.rb +53 -0
- data/spec/models/budget_details_spec.rb +99 -0
- data/spec/models/business_financial_health_check_request_spec.rb +143 -0
- data/spec/models/business_invoice_analysis_request_spec.rb +123 -0
- data/spec/models/calculator_deposit_schedule1_spec.rb +57 -0
- data/spec/models/calculator_deposit_schedule_spec.rb +51 -0
- data/spec/models/card_analysis_request_spec.rb +129 -0
- data/spec/models/card_limit_check_request_spec.rb +65 -0
- data/spec/models/card_transaction_authorization_request_spec.rb +157 -0
- data/spec/models/cash_analysis_request_spec.rb +115 -0
- data/spec/models/cash_flow_analysis_request_spec.rb +135 -0
- data/spec/models/children_education_config_spec.rb +47 -0
- data/spec/models/customer_analysis_request_spec.rb +101 -0
- data/spec/models/decision_tree_result_request_spec.rb +51 -0
- data/spec/models/decumulation_goal_deposit_config_spec.rb +89 -0
- data/spec/models/dimensional_risk_score_request_spec.rb +89 -0
- data/spec/models/diversification_score_request_spec.rb +111 -0
- data/spec/models/education_calculator_annual_cost_request_spec.rb +101 -0
- data/spec/models/education_calculator_deposit_amount_request_spec.rb +107 -0
- data/spec/models/education_calculator_percent_covered_request_spec.rb +101 -0
- data/spec/models/education_config_spec.rb +53 -0
- data/spec/models/emergency_fund_calculator_request_spec.rb +141 -0
- data/spec/models/event_study_request_spec.rb +109 -0
- data/spec/models/fee_analysis_request_spec.rb +77 -0
- data/spec/models/financial_health_check_request_spec.rb +95 -0
- data/spec/models/financial_picture_request_spec.rb +95 -0
- data/spec/models/financial_statement_analysis_request_spec.rb +155 -0
- data/spec/models/goal_accumulation_allocation_request_spec.rb +215 -0
- data/spec/models/goal_accumulation_recommendation_request_spec.rb +173 -0
- data/spec/models/goal_accumulation_status_request_spec.rb +173 -0
- data/spec/models/goal_config_spec.rb +47 -0
- data/spec/models/goal_decumulation_allocation_request_spec.rb +221 -0
- data/spec/models/goal_decumulation_recommendation_request_spec.rb +179 -0
- data/spec/models/goal_decumulation_status_request_spec.rb +179 -0
- data/spec/models/goal_withdrawal_config_spec.rb +89 -0
- data/spec/models/guaranteed_rate_benefit_spec.rb +59 -0
- data/spec/models/income_config_spec.rb +53 -0
- data/spec/models/life_insurance_needs_calculator_request_spec.rb +125 -0
- data/spec/models/location_spec.rb +41 -0
- data/spec/models/monte_carlo_request_spec.rb +179 -0
- data/spec/models/mortgage_calculator_down_payment_request_spec.rb +59 -0
- data/spec/models/mortgage_calculator_home_price_request_spec.rb +59 -0
- data/spec/models/mortgage_calculator_periodic_payment_request_spec.rb +59 -0
- data/spec/models/mvo_request_spec.rb +113 -0
- data/spec/models/opt_config1_spec.rb +69 -0
- data/spec/models/opt_config_spec.rb +81 -0
- data/spec/models/order_rebalance_request_spec.rb +123 -0
- data/spec/models/performance_calculator_request_spec.rb +233 -0
- data/spec/models/periods_spec.rb +47 -0
- data/spec/models/portfolio_optimization_score_request_spec.rb +127 -0
- data/spec/models/portfolio_what_if_request_spec.rb +123 -0
- data/spec/models/purchase_calculator_amount_request_spec.rb +93 -0
- data/spec/models/purchase_calculator_deposit_amount_request_spec.rb +99 -0
- data/spec/models/purchase_calculator_horizon_request_spec.rb +83 -0
- data/spec/models/ratio_targets1_spec.rb +71 -0
- data/spec/models/ratio_targets_spec.rb +71 -0
- data/spec/models/rebalancing_signal_request_spec.rb +71 -0
- data/spec/models/recommendation_config1_spec.rb +77 -0
- data/spec/models/recommendation_config_spec.rb +83 -0
- data/spec/models/recurring_transaction_analysis_request_spec.rb +129 -0
- data/spec/models/retirement_calculator_deposit_amount_request_spec.rb +113 -0
- data/spec/models/retirement_calculator_expenses_request_spec.rb +107 -0
- data/spec/models/retirement_calculator_percent_covered_request_spec.rb +107 -0
- data/spec/models/risk_allocation_request_spec.rb +85 -0
- data/spec/models/risk_score_request_spec.rb +71 -0
- data/spec/models/savings_calculator_request_spec.rb +99 -0
- data/spec/models/savings_deposit_schedule_spec.rb +63 -0
- data/spec/models/scenario_analysis_request_spec.rb +133 -0
- data/spec/models/sensitivity_analysis_request_spec.rb +133 -0
- data/spec/models/sensitivity_factor_spec.rb +59 -0
- data/spec/models/settings_spec.rb +79 -0
- data/spec/models/spending_analysis_request_spec.rb +187 -0
- data/spec/models/variable_annuity_request_spec.rb +209 -0
- data/spec/models/w_config1_spec.rb +65 -0
- data/spec/models/w_config_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +561 -0
@@ -0,0 +1,231 @@
|
|
1
|
+
=begin
|
2
|
+
#Hydrogen Proton API
|
3
|
+
|
4
|
+
#Financial engineering module of Hydrogen Atom
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.9.1
|
7
|
+
Contact: info@hydrogenplatform.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module ProtonApi
|
16
|
+
class CardLimitCheckRequest
|
17
|
+
attr_accessor :currency_code
|
18
|
+
|
19
|
+
attr_accessor :client_id
|
20
|
+
|
21
|
+
attr_accessor :as_of_date
|
22
|
+
|
23
|
+
attr_accessor :transaction_status_scope
|
24
|
+
|
25
|
+
attr_accessor :create_log
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'currency_code' => :'currency_code',
|
31
|
+
:'client_id' => :'client_id',
|
32
|
+
:'as_of_date' => :'as_of_date',
|
33
|
+
:'transaction_status_scope' => :'transaction_status_scope',
|
34
|
+
:'create_log' => :'create_log'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'currency_code' => :'String',
|
42
|
+
:'client_id' => :'String',
|
43
|
+
:'as_of_date' => :'DateTime',
|
44
|
+
:'transaction_status_scope' => :'Array<String>',
|
45
|
+
:'create_log' => :'BOOLEAN'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
56
|
+
|
57
|
+
if attributes.has_key?(:'currency_code')
|
58
|
+
self.currency_code = attributes[:'currency_code']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'client_id')
|
62
|
+
self.client_id = attributes[:'client_id']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'as_of_date')
|
66
|
+
self.as_of_date = attributes[:'as_of_date']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'transaction_status_scope')
|
70
|
+
if (value = attributes[:'transaction_status_scope']).is_a?(Array)
|
71
|
+
self.transaction_status_scope = value
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'create_log')
|
76
|
+
self.create_log = attributes[:'create_log']
|
77
|
+
else
|
78
|
+
self.create_log = false
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
83
|
+
# @return Array for valid properties with the reasons
|
84
|
+
def list_invalid_properties
|
85
|
+
invalid_properties = Array.new
|
86
|
+
if @currency_code.nil?
|
87
|
+
invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
if @client_id.nil?
|
91
|
+
invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
|
92
|
+
end
|
93
|
+
|
94
|
+
invalid_properties
|
95
|
+
end
|
96
|
+
|
97
|
+
# Check to see if the all the properties in the model are valid
|
98
|
+
# @return true if the model is valid
|
99
|
+
def valid?
|
100
|
+
return false if @currency_code.nil?
|
101
|
+
return false if @client_id.nil?
|
102
|
+
true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
currency_code == o.currency_code &&
|
111
|
+
client_id == o.client_id &&
|
112
|
+
as_of_date == o.as_of_date &&
|
113
|
+
transaction_status_scope == o.transaction_status_scope &&
|
114
|
+
create_log == o.create_log
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Fixnum] Hash code
|
125
|
+
def hash
|
126
|
+
[currency_code, client_id, as_of_date, transaction_status_scope, create_log].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def build_from_hash(attributes)
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
134
|
+
self.class.swagger_types.each_pair do |key, type|
|
135
|
+
if type =~ /\AArray<(.*)>/i
|
136
|
+
# check to ensure the input is an array given that the attribute
|
137
|
+
# is documented as an array but the input is not
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
140
|
+
end
|
141
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
143
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
144
|
+
end
|
145
|
+
|
146
|
+
self
|
147
|
+
end
|
148
|
+
# Deserializes the data based on type
|
149
|
+
# @param string type Data type
|
150
|
+
# @param string value Value to be deserialized
|
151
|
+
# @return [Object] Deserialized data
|
152
|
+
def _deserialize(type, value)
|
153
|
+
case type.to_sym
|
154
|
+
when :DateTime
|
155
|
+
value
|
156
|
+
when :Date
|
157
|
+
value
|
158
|
+
when :String
|
159
|
+
value.to_s
|
160
|
+
when :Integer
|
161
|
+
value.to_i
|
162
|
+
when :Float
|
163
|
+
value.to_f
|
164
|
+
when :BOOLEAN
|
165
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
166
|
+
true
|
167
|
+
else
|
168
|
+
false
|
169
|
+
end
|
170
|
+
when :Object
|
171
|
+
# generic object (usually a Hash), return directly
|
172
|
+
value
|
173
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
174
|
+
inner_type = Regexp.last_match[:inner_type]
|
175
|
+
value.map { |v| _deserialize(inner_type, v) }
|
176
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
177
|
+
k_type = Regexp.last_match[:k_type]
|
178
|
+
v_type = Regexp.last_match[:v_type]
|
179
|
+
{}.tap do |hash|
|
180
|
+
value.each do |k, v|
|
181
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
else # model
|
185
|
+
temp_model = ProtonApi.const_get(type).new
|
186
|
+
temp_model.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
# Returns the string representation of the object
|
190
|
+
# @return [String] String presentation of the object
|
191
|
+
def to_s
|
192
|
+
to_hash.to_s
|
193
|
+
end
|
194
|
+
|
195
|
+
# to_body is an alias to to_hash (backward compatibility)
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the object in the form of hash
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_hash
|
204
|
+
hash = {}
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
206
|
+
value = self.send(attr)
|
207
|
+
next if value.nil?
|
208
|
+
hash[param] = _to_hash(value)
|
209
|
+
end
|
210
|
+
hash
|
211
|
+
end
|
212
|
+
# Outputs non-array value in the form of hash
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
214
|
+
# @param [Object] value Any valid value
|
215
|
+
# @return [Hash] Returns the value in the form of hash
|
216
|
+
def _to_hash(value)
|
217
|
+
if value.is_a?(Array)
|
218
|
+
value.compact.map { |v| _to_hash(v) }
|
219
|
+
elsif value.is_a?(Hash)
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
222
|
+
end
|
223
|
+
elsif value.respond_to? :to_hash
|
224
|
+
value.to_hash
|
225
|
+
else
|
226
|
+
value
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
231
|
+
end
|
@@ -0,0 +1,422 @@
|
|
1
|
+
=begin
|
2
|
+
#Hydrogen Proton API
|
3
|
+
|
4
|
+
#Financial engineering module of Hydrogen Atom
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.9.1
|
7
|
+
Contact: info@hydrogenplatform.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.19
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module ProtonApi
|
16
|
+
class CardTransactionAuthorizationRequest
|
17
|
+
attr_accessor :currency_code
|
18
|
+
|
19
|
+
attr_accessor :memo
|
20
|
+
|
21
|
+
attr_accessor :partial_auth
|
22
|
+
|
23
|
+
attr_accessor :transaction_type
|
24
|
+
|
25
|
+
attr_accessor :description
|
26
|
+
|
27
|
+
attr_accessor :transaction_category_id
|
28
|
+
|
29
|
+
attr_accessor :use_audit_log
|
30
|
+
|
31
|
+
attr_accessor :merchant_category_code
|
32
|
+
|
33
|
+
attr_accessor :card_id
|
34
|
+
|
35
|
+
attr_accessor :transaction_category
|
36
|
+
|
37
|
+
attr_accessor :cleanse_data
|
38
|
+
|
39
|
+
attr_accessor :auth_type
|
40
|
+
|
41
|
+
attr_accessor :mid
|
42
|
+
|
43
|
+
attr_accessor :transaction_status_scope
|
44
|
+
|
45
|
+
attr_accessor :location
|
46
|
+
|
47
|
+
attr_accessor :merchant
|
48
|
+
|
49
|
+
attr_accessor :amount
|
50
|
+
|
51
|
+
attr_accessor :date
|
52
|
+
|
53
|
+
attr_accessor :merchant_id
|
54
|
+
|
55
|
+
class EnumAttributeValidator
|
56
|
+
attr_reader :datatype
|
57
|
+
attr_reader :allowable_values
|
58
|
+
|
59
|
+
def initialize(datatype, allowable_values)
|
60
|
+
@allowable_values = allowable_values.map do |value|
|
61
|
+
case datatype.to_s
|
62
|
+
when /Integer/i
|
63
|
+
value.to_i
|
64
|
+
when /Float/i
|
65
|
+
value.to_f
|
66
|
+
else
|
67
|
+
value
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def valid?(value)
|
73
|
+
!value || allowable_values.include?(value)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
78
|
+
def self.attribute_map
|
79
|
+
{
|
80
|
+
:'currency_code' => :'currency_code',
|
81
|
+
:'memo' => :'memo',
|
82
|
+
:'partial_auth' => :'partial_auth',
|
83
|
+
:'transaction_type' => :'transaction_type',
|
84
|
+
:'description' => :'description',
|
85
|
+
:'transaction_category_id' => :'transaction_category_id',
|
86
|
+
:'use_audit_log' => :'use_audit_log',
|
87
|
+
:'merchant_category_code' => :'merchant_category_code',
|
88
|
+
:'card_id' => :'card_id',
|
89
|
+
:'transaction_category' => :'transaction_category',
|
90
|
+
:'cleanse_data' => :'cleanse_data',
|
91
|
+
:'auth_type' => :'auth_type',
|
92
|
+
:'mid' => :'mid',
|
93
|
+
:'transaction_status_scope' => :'transaction_status_scope',
|
94
|
+
:'location' => :'location',
|
95
|
+
:'merchant' => :'merchant',
|
96
|
+
:'amount' => :'amount',
|
97
|
+
:'date' => :'date',
|
98
|
+
:'merchant_id' => :'merchant_id'
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
# Attribute type mapping.
|
103
|
+
def self.swagger_types
|
104
|
+
{
|
105
|
+
:'currency_code' => :'String',
|
106
|
+
:'memo' => :'String',
|
107
|
+
:'partial_auth' => :'BOOLEAN',
|
108
|
+
:'transaction_type' => :'String',
|
109
|
+
:'description' => :'String',
|
110
|
+
:'transaction_category_id' => :'String',
|
111
|
+
:'use_audit_log' => :'BOOLEAN',
|
112
|
+
:'merchant_category_code' => :'Integer',
|
113
|
+
:'card_id' => :'String',
|
114
|
+
:'transaction_category' => :'String',
|
115
|
+
:'cleanse_data' => :'BOOLEAN',
|
116
|
+
:'auth_type' => :'Array<String>',
|
117
|
+
:'mid' => :'String',
|
118
|
+
:'transaction_status_scope' => :'Array<String>',
|
119
|
+
:'location' => :'Location',
|
120
|
+
:'merchant' => :'String',
|
121
|
+
:'amount' => :'Float',
|
122
|
+
:'date' => :'DateTime',
|
123
|
+
:'merchant_id' => :'String'
|
124
|
+
}
|
125
|
+
end
|
126
|
+
|
127
|
+
# Initializes the object
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
def initialize(attributes = {})
|
130
|
+
return unless attributes.is_a?(Hash)
|
131
|
+
|
132
|
+
# convert string to symbol for hash key
|
133
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
134
|
+
|
135
|
+
if attributes.has_key?(:'currency_code')
|
136
|
+
self.currency_code = attributes[:'currency_code']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'memo')
|
140
|
+
self.memo = attributes[:'memo']
|
141
|
+
else
|
142
|
+
self.memo = 'null'
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'partial_auth')
|
146
|
+
self.partial_auth = attributes[:'partial_auth']
|
147
|
+
else
|
148
|
+
self.partial_auth = false
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'transaction_type')
|
152
|
+
self.transaction_type = attributes[:'transaction_type']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.has_key?(:'description')
|
156
|
+
self.description = attributes[:'description']
|
157
|
+
else
|
158
|
+
self.description = 'null'
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'transaction_category_id')
|
162
|
+
self.transaction_category_id = attributes[:'transaction_category_id']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'use_audit_log')
|
166
|
+
self.use_audit_log = attributes[:'use_audit_log']
|
167
|
+
else
|
168
|
+
self.use_audit_log = false
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.has_key?(:'merchant_category_code')
|
172
|
+
self.merchant_category_code = attributes[:'merchant_category_code']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.has_key?(:'card_id')
|
176
|
+
self.card_id = attributes[:'card_id']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.has_key?(:'transaction_category')
|
180
|
+
self.transaction_category = attributes[:'transaction_category']
|
181
|
+
else
|
182
|
+
self.transaction_category = 'null'
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'cleanse_data')
|
186
|
+
self.cleanse_data = attributes[:'cleanse_data']
|
187
|
+
else
|
188
|
+
self.cleanse_data = false
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.has_key?(:'auth_type')
|
192
|
+
if (value = attributes[:'auth_type']).is_a?(Array)
|
193
|
+
self.auth_type = value
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.has_key?(:'mid')
|
198
|
+
self.mid = attributes[:'mid']
|
199
|
+
else
|
200
|
+
self.mid = 'null'
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.has_key?(:'transaction_status_scope')
|
204
|
+
if (value = attributes[:'transaction_status_scope']).is_a?(Array)
|
205
|
+
self.transaction_status_scope = value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.has_key?(:'location')
|
210
|
+
self.location = attributes[:'location']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.has_key?(:'merchant')
|
214
|
+
self.merchant = attributes[:'merchant']
|
215
|
+
else
|
216
|
+
self.merchant = 'null'
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.has_key?(:'amount')
|
220
|
+
self.amount = attributes[:'amount']
|
221
|
+
end
|
222
|
+
|
223
|
+
if attributes.has_key?(:'date')
|
224
|
+
self.date = attributes[:'date']
|
225
|
+
end
|
226
|
+
|
227
|
+
if attributes.has_key?(:'merchant_id')
|
228
|
+
self.merchant_id = attributes[:'merchant_id']
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
233
|
+
# @return Array for valid properties with the reasons
|
234
|
+
def list_invalid_properties
|
235
|
+
invalid_properties = Array.new
|
236
|
+
if @currency_code.nil?
|
237
|
+
invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
|
238
|
+
end
|
239
|
+
|
240
|
+
if @transaction_type.nil?
|
241
|
+
invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.')
|
242
|
+
end
|
243
|
+
|
244
|
+
if @card_id.nil?
|
245
|
+
invalid_properties.push('invalid value for "card_id", card_id cannot be nil.')
|
246
|
+
end
|
247
|
+
|
248
|
+
if @amount.nil?
|
249
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
250
|
+
end
|
251
|
+
|
252
|
+
if @date.nil?
|
253
|
+
invalid_properties.push('invalid value for "date", date cannot be nil.')
|
254
|
+
end
|
255
|
+
|
256
|
+
invalid_properties
|
257
|
+
end
|
258
|
+
|
259
|
+
# Check to see if the all the properties in the model are valid
|
260
|
+
# @return true if the model is valid
|
261
|
+
def valid?
|
262
|
+
return false if @currency_code.nil?
|
263
|
+
return false if @transaction_type.nil?
|
264
|
+
transaction_type_validator = EnumAttributeValidator.new('String', ['atm_withdrawal', 'purchase', 'other'])
|
265
|
+
return false unless transaction_type_validator.valid?(@transaction_type)
|
266
|
+
return false if @card_id.nil?
|
267
|
+
return false if @amount.nil?
|
268
|
+
return false if @date.nil?
|
269
|
+
true
|
270
|
+
end
|
271
|
+
|
272
|
+
# Custom attribute writer method checking allowed values (enum).
|
273
|
+
# @param [Object] transaction_type Object to be assigned
|
274
|
+
def transaction_type=(transaction_type)
|
275
|
+
validator = EnumAttributeValidator.new('String', ['atm_withdrawal', 'purchase', 'other'])
|
276
|
+
unless validator.valid?(transaction_type)
|
277
|
+
fail ArgumentError, 'invalid value for "transaction_type", must be one of #{validator.allowable_values}.'
|
278
|
+
end
|
279
|
+
@transaction_type = transaction_type
|
280
|
+
end
|
281
|
+
|
282
|
+
# Checks equality by comparing each attribute.
|
283
|
+
# @param [Object] Object to be compared
|
284
|
+
def ==(o)
|
285
|
+
return true if self.equal?(o)
|
286
|
+
self.class == o.class &&
|
287
|
+
currency_code == o.currency_code &&
|
288
|
+
memo == o.memo &&
|
289
|
+
partial_auth == o.partial_auth &&
|
290
|
+
transaction_type == o.transaction_type &&
|
291
|
+
description == o.description &&
|
292
|
+
transaction_category_id == o.transaction_category_id &&
|
293
|
+
use_audit_log == o.use_audit_log &&
|
294
|
+
merchant_category_code == o.merchant_category_code &&
|
295
|
+
card_id == o.card_id &&
|
296
|
+
transaction_category == o.transaction_category &&
|
297
|
+
cleanse_data == o.cleanse_data &&
|
298
|
+
auth_type == o.auth_type &&
|
299
|
+
mid == o.mid &&
|
300
|
+
transaction_status_scope == o.transaction_status_scope &&
|
301
|
+
location == o.location &&
|
302
|
+
merchant == o.merchant &&
|
303
|
+
amount == o.amount &&
|
304
|
+
date == o.date &&
|
305
|
+
merchant_id == o.merchant_id
|
306
|
+
end
|
307
|
+
|
308
|
+
# @see the `==` method
|
309
|
+
# @param [Object] Object to be compared
|
310
|
+
def eql?(o)
|
311
|
+
self == o
|
312
|
+
end
|
313
|
+
|
314
|
+
# Calculates hash code according to all attributes.
|
315
|
+
# @return [Fixnum] Hash code
|
316
|
+
def hash
|
317
|
+
[currency_code, memo, partial_auth, transaction_type, description, transaction_category_id, use_audit_log, merchant_category_code, card_id, transaction_category, cleanse_data, auth_type, mid, transaction_status_scope, location, merchant, amount, date, merchant_id].hash
|
318
|
+
end
|
319
|
+
|
320
|
+
# Builds the object from hash
|
321
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
322
|
+
# @return [Object] Returns the model itself
|
323
|
+
def build_from_hash(attributes)
|
324
|
+
return nil unless attributes.is_a?(Hash)
|
325
|
+
self.class.swagger_types.each_pair do |key, type|
|
326
|
+
if type =~ /\AArray<(.*)>/i
|
327
|
+
# check to ensure the input is an array given that the attribute
|
328
|
+
# is documented as an array but the input is not
|
329
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
330
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
331
|
+
end
|
332
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
333
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
334
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
335
|
+
end
|
336
|
+
|
337
|
+
self
|
338
|
+
end
|
339
|
+
# Deserializes the data based on type
|
340
|
+
# @param string type Data type
|
341
|
+
# @param string value Value to be deserialized
|
342
|
+
# @return [Object] Deserialized data
|
343
|
+
def _deserialize(type, value)
|
344
|
+
case type.to_sym
|
345
|
+
when :DateTime
|
346
|
+
value
|
347
|
+
when :Date
|
348
|
+
value
|
349
|
+
when :String
|
350
|
+
value.to_s
|
351
|
+
when :Integer
|
352
|
+
value.to_i
|
353
|
+
when :Float
|
354
|
+
value.to_f
|
355
|
+
when :BOOLEAN
|
356
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
357
|
+
true
|
358
|
+
else
|
359
|
+
false
|
360
|
+
end
|
361
|
+
when :Object
|
362
|
+
# generic object (usually a Hash), return directly
|
363
|
+
value
|
364
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
365
|
+
inner_type = Regexp.last_match[:inner_type]
|
366
|
+
value.map { |v| _deserialize(inner_type, v) }
|
367
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
368
|
+
k_type = Regexp.last_match[:k_type]
|
369
|
+
v_type = Regexp.last_match[:v_type]
|
370
|
+
{}.tap do |hash|
|
371
|
+
value.each do |k, v|
|
372
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
373
|
+
end
|
374
|
+
end
|
375
|
+
else # model
|
376
|
+
temp_model = ProtonApi.const_get(type).new
|
377
|
+
temp_model.build_from_hash(value)
|
378
|
+
end
|
379
|
+
end
|
380
|
+
# Returns the string representation of the object
|
381
|
+
# @return [String] String presentation of the object
|
382
|
+
def to_s
|
383
|
+
to_hash.to_s
|
384
|
+
end
|
385
|
+
|
386
|
+
# to_body is an alias to to_hash (backward compatibility)
|
387
|
+
# @return [Hash] Returns the object in the form of hash
|
388
|
+
def to_body
|
389
|
+
to_hash
|
390
|
+
end
|
391
|
+
|
392
|
+
# Returns the object in the form of hash
|
393
|
+
# @return [Hash] Returns the object in the form of hash
|
394
|
+
def to_hash
|
395
|
+
hash = {}
|
396
|
+
self.class.attribute_map.each_pair do |attr, param|
|
397
|
+
value = self.send(attr)
|
398
|
+
next if value.nil?
|
399
|
+
hash[param] = _to_hash(value)
|
400
|
+
end
|
401
|
+
hash
|
402
|
+
end
|
403
|
+
# Outputs non-array value in the form of hash
|
404
|
+
# For object, use to_hash. Otherwise, just return the value
|
405
|
+
# @param [Object] value Any valid value
|
406
|
+
# @return [Hash] Returns the value in the form of hash
|
407
|
+
def _to_hash(value)
|
408
|
+
if value.is_a?(Array)
|
409
|
+
value.compact.map { |v| _to_hash(v) }
|
410
|
+
elsif value.is_a?(Hash)
|
411
|
+
{}.tap do |hash|
|
412
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
413
|
+
end
|
414
|
+
elsif value.respond_to? :to_hash
|
415
|
+
value.to_hash
|
416
|
+
else
|
417
|
+
value
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
end
|
422
|
+
end
|