moneykit 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +291 -0
- data/lib/moneykit/api/access_token_api.rb +224 -0
- data/lib/moneykit/api/account_numbers_api.rb +88 -0
- data/lib/moneykit/api/accounts_api.rb +301 -0
- data/lib/moneykit/api/identity_api.rb +91 -0
- data/lib/moneykit/api/institutions_api.rb +234 -0
- data/lib/moneykit/api/link_session_api.rb +164 -0
- data/lib/moneykit/api/links_api.rb +297 -0
- data/lib/moneykit/api/products_api.rb +99 -0
- data/lib/moneykit/api/transactions_api.rb +297 -0
- data/lib/moneykit/api/users_api.rb +262 -0
- data/lib/moneykit/api_client.rb +428 -0
- data/lib/moneykit/api_error.rb +58 -0
- data/lib/moneykit/configuration.rb +404 -0
- data/lib/moneykit/models/account.rb +301 -0
- data/lib/moneykit/models/account_balances.rb +279 -0
- data/lib/moneykit/models/account_group.rb +237 -0
- data/lib/moneykit/models/account_identity.rb +318 -0
- data/lib/moneykit/models/account_numbers.rb +241 -0
- data/lib/moneykit/models/account_numbers_link_product.rb +246 -0
- data/lib/moneykit/models/account_numbers_product_settings.rb +234 -0
- data/lib/moneykit/models/account_type.rb +49 -0
- data/lib/moneykit/models/account_with_account_numbers.rb +315 -0
- data/lib/moneykit/models/accounts_link_product.rb +232 -0
- data/lib/moneykit/models/ach_number.rb +251 -0
- data/lib/moneykit/models/address.rb +277 -0
- data/lib/moneykit/models/api_error_auth_expired_access_token_response.rb +277 -0
- data/lib/moneykit/models/api_error_auth_unauthorized_response.rb +280 -0
- data/lib/moneykit/models/api_error_rate_limit_exceeded_response.rb +277 -0
- data/lib/moneykit/models/app.rb +248 -0
- data/lib/moneykit/models/bacs_number.rb +240 -0
- data/lib/moneykit/models/balances.rb +287 -0
- data/lib/moneykit/models/basic_account_details.rb +265 -0
- data/lib/moneykit/models/country.rb +41 -0
- data/lib/moneykit/models/create_link_session_request.rb +336 -0
- data/lib/moneykit/models/create_link_session_response.rb +225 -0
- data/lib/moneykit/models/currency.rb +219 -0
- data/lib/moneykit/models/cursor.rb +229 -0
- data/lib/moneykit/models/cursor_pagination.rb +221 -0
- data/lib/moneykit/models/cursors.rb +229 -0
- data/lib/moneykit/models/customer_app.rb +241 -0
- data/lib/moneykit/models/customer_user.rb +292 -0
- data/lib/moneykit/models/eft_number.rb +255 -0
- data/lib/moneykit/models/email.rb +237 -0
- data/lib/moneykit/models/email1.rb +283 -0
- data/lib/moneykit/models/exchange_token_request.rb +225 -0
- data/lib/moneykit/models/exchange_token_response.rb +239 -0
- data/lib/moneykit/models/generate_access_token_response.rb +256 -0
- data/lib/moneykit/models/get_account_numbers_response.rb +240 -0
- data/lib/moneykit/models/get_account_response.rb +238 -0
- data/lib/moneykit/models/get_accounts_response.rb +241 -0
- data/lib/moneykit/models/get_institutions_response.rb +241 -0
- data/lib/moneykit/models/get_transactions_response.rb +303 -0
- data/lib/moneykit/models/get_user_accounts_response.rb +227 -0
- data/lib/moneykit/models/get_user_links_response.rb +227 -0
- data/lib/moneykit/models/get_user_transactions_response.rb +287 -0
- data/lib/moneykit/models/http_validation_error.rb +293 -0
- data/lib/moneykit/models/identity.rb +241 -0
- data/lib/moneykit/models/identity_link_product.rb +246 -0
- data/lib/moneykit/models/identity_product_settings.rb +234 -0
- data/lib/moneykit/models/identity_response.rb +241 -0
- data/lib/moneykit/models/institution.rb +345 -0
- data/lib/moneykit/models/institution_error_not_found_response.rb +276 -0
- data/lib/moneykit/models/institution_styling_response.rb +310 -0
- data/lib/moneykit/models/international_number.rb +240 -0
- data/lib/moneykit/models/introspect_client_response.rb +281 -0
- data/lib/moneykit/models/jwk_set.rb +227 -0
- data/lib/moneykit/models/link.rb +347 -0
- data/lib/moneykit/models/link1.rb +347 -0
- data/lib/moneykit/models/link2.rb +347 -0
- data/lib/moneykit/models/link3.rb +347 -0
- data/lib/moneykit/models/link4.rb +347 -0
- data/lib/moneykit/models/link_common.rb +339 -0
- data/lib/moneykit/models/link_error.rb +45 -0
- data/lib/moneykit/models/link_error_bad_state_response.rb +294 -0
- data/lib/moneykit/models/link_error_deleted_response.rb +277 -0
- data/lib/moneykit/models/link_error_forbidden_action_response.rb +280 -0
- data/lib/moneykit/models/link_error_not_found_response.rb +276 -0
- data/lib/moneykit/models/link_error_unauthorized_access_response.rb +276 -0
- data/lib/moneykit/models/link_permission_scope.rb +42 -0
- data/lib/moneykit/models/link_permissions.rb +234 -0
- data/lib/moneykit/models/link_products.rb +246 -0
- data/lib/moneykit/models/link_response.rb +364 -0
- data/lib/moneykit/models/link_session_customer_user.rb +284 -0
- data/lib/moneykit/models/link_session_customer_user_email.rb +275 -0
- data/lib/moneykit/models/link_session_customer_user_phone.rb +307 -0
- data/lib/moneykit/models/link_session_error_forbidden_config_response.rb +280 -0
- data/lib/moneykit/models/link_session_error_invalid_token_exchange.rb +280 -0
- data/lib/moneykit/models/link_session_setting_overrides.rb +268 -0
- data/lib/moneykit/models/link_state.rb +43 -0
- data/lib/moneykit/models/link_state_changed_webhook.rb +392 -0
- data/lib/moneykit/models/location_inner.rb +230 -0
- data/lib/moneykit/models/money_kit_env.rb +40 -0
- data/lib/moneykit/models/money_link_features.rb +234 -0
- data/lib/moneykit/models/moneylink_features.rb +242 -0
- data/lib/moneykit/models/numbers.rb +286 -0
- data/lib/moneykit/models/owner.rb +278 -0
- data/lib/moneykit/models/phone.rb +315 -0
- data/lib/moneykit/models/phone_number.rb +273 -0
- data/lib/moneykit/models/phone_number_type.rb +42 -0
- data/lib/moneykit/models/product.rb +42 -0
- data/lib/moneykit/models/products.rb +254 -0
- data/lib/moneykit/models/products1.rb +245 -0
- data/lib/moneykit/models/products_settings.rb +237 -0
- data/lib/moneykit/models/provider.rb +43 -0
- data/lib/moneykit/models/refresh_products_request.rb +237 -0
- data/lib/moneykit/models/requested_link_permission.rb +276 -0
- data/lib/moneykit/models/response401_disconnect_links_id_delete.rb +302 -0
- data/lib/moneykit/models/response401_exchange_token_link_session_exchange_token_post.rb +300 -0
- data/lib/moneykit/models/response401_get_account_links_id_accounts_account_id_get.rb +302 -0
- data/lib/moneykit/models/response401_get_account_numbers_links_id_accounts_numbers_get.rb +302 -0
- data/lib/moneykit/models/response401_get_accounts_links_id_accounts_get.rb +302 -0
- data/lib/moneykit/models/response401_get_identities_links_id_identity_get.rb +302 -0
- data/lib/moneykit/models/response401_get_institution_institutions_institution_id_get.rb +300 -0
- data/lib/moneykit/models/response401_get_institution_styling_institutions_institution_id_styling_get.rb +300 -0
- data/lib/moneykit/models/response401_get_institutions_institutions_get.rb +300 -0
- data/lib/moneykit/models/response401_get_link_links_id_get.rb +302 -0
- data/lib/moneykit/models/response401_get_transactions_diff_links_id_transactions_sync_get.rb +302 -0
- data/lib/moneykit/models/response401_get_transactions_links_id_transactions_get.rb +302 -0
- data/lib/moneykit/models/response401_get_user_accounts_users_id_accounts_get.rb +300 -0
- data/lib/moneykit/models/response401_get_user_links_users_id_links_get.rb +300 -0
- data/lib/moneykit/models/response401_get_user_transactions_users_id_transactions_get.rb +300 -0
- data/lib/moneykit/models/response401_get_well_known_jwks_well_known_jwks_json_get.rb +300 -0
- data/lib/moneykit/models/response401_instrospect_client_auth_introspect_get.rb +300 -0
- data/lib/moneykit/models/response401_refresh_products_links_id_products_post.rb +302 -0
- data/lib/moneykit/models/response401_update_link_links_id_patch.rb +302 -0
- data/lib/moneykit/models/settings.rb +276 -0
- data/lib/moneykit/models/supported_version.rb +39 -0
- data/lib/moneykit/models/transaction.rb +369 -0
- data/lib/moneykit/models/transaction_diff.rb +261 -0
- data/lib/moneykit/models/transaction_sync_response.rb +267 -0
- data/lib/moneykit/models/transaction_type.rb +40 -0
- data/lib/moneykit/models/transaction_type_filter.rb +40 -0
- data/lib/moneykit/models/transactions.rb +253 -0
- data/lib/moneykit/models/transactions1.rb +269 -0
- data/lib/moneykit/models/transactions_link_product.rb +246 -0
- data/lib/moneykit/models/transactions_product_settings.rb +246 -0
- data/lib/moneykit/models/update_link_request.rb +258 -0
- data/lib/moneykit/models/user_accounts_out.rb +221 -0
- data/lib/moneykit/models/user_links_out.rb +221 -0
- data/lib/moneykit/models/user_transactions_paged_response.rb +221 -0
- data/lib/moneykit/models/validation_error.rb +254 -0
- data/lib/moneykit/version.rb +15 -0
- data/lib/moneykit.rb +180 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/api/plaid_api.rb +744 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/api_client.rb +400 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/api_error.rb +57 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/configuration.rb +287 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_balance.rb +254 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_base.rb +289 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_identity.rb +306 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_subtype.rb +110 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_type.rb +43 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/accounts_get_request.rb +256 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/accounts_get_request_options.rb +223 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/accounts_get_response.rb +256 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/address.rb +235 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/address_data.rb +269 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_numbers.rb +278 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_request.rb +256 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_request_options.rb +223 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_response.rb +270 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/country_code.rb +40 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/email.rb +240 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/http_validation_error.rb +220 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/identity_get_request.rb +256 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/identity_get_request_options.rb +223 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/identity_get_response.rb +256 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/institution.rb +279 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/institutions_get_by_id_request.rb +260 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/institutions_get_by_id_response.rb +239 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item.rb +317 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_error_webhook.rb +279 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_get_request.rb +247 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_get_response.rb +249 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_public_token_exchange_request.rb +247 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_public_token_exchange_response.rb +255 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_remove_request.rb +247 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_remove_response.rb +225 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_investments.rb +232 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_last_webhook.rb +232 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_nullable.rb +240 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_transactions.rb +232 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/link_token_create_request.rb +352 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/link_token_create_request_user.rb +269 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/link_token_create_response.rb +255 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_ach.rb +266 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_bacs.rb +255 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_eft.rb +270 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_international.rb +255 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/owner.rb +278 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/personal_finance_category.rb +240 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/phone_number.rb +255 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/plaid_error.rb +322 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/plaid_error_type.rb +51 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/products.rb +41 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/removed_transaction.rb +221 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transaction.rb +378 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_get_request.rb +286 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_get_request_options.rb +267 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_get_response.rb +288 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_refresh_request.rb +247 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_refresh_response.rb +225 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_sync_request.rb +278 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_sync_request_options.rb +232 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_sync_response.rb +306 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/validation_error.rb +253 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/models/webhook_environment_values.rb +40 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible/version.rb +15 -0
- data/lib/plaid_compatible/money_kit_plaid_compatible.rb +100 -0
- data/moneykit-0.0.0.gem +0 -0
- data/moneykit.gemspec +39 -0
- metadata +309 -0
@@ -0,0 +1,276 @@
|
|
1
|
+
=begin
|
2
|
+
#MoneyKit API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.5.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MoneyKit
|
17
|
+
# If provided, these settings will override your default settings for this session.
|
18
|
+
class Settings
|
19
|
+
# If provided, restricts the available institutions to those supported by **any** of these providers.
|
20
|
+
attr_accessor :providers
|
21
|
+
|
22
|
+
attr_accessor :link_permissions
|
23
|
+
|
24
|
+
attr_accessor :products
|
25
|
+
|
26
|
+
# Restricts the available institutions to those in **any** of these countries.
|
27
|
+
attr_accessor :countries
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'providers' => :'providers',
|
33
|
+
:'link_permissions' => :'link_permissions',
|
34
|
+
:'products' => :'products',
|
35
|
+
:'countries' => :'countries'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns all the JSON keys this model knows about
|
40
|
+
def self.acceptable_attributes
|
41
|
+
attribute_map.values
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'providers' => :'Array<Provider>',
|
48
|
+
:'link_permissions' => :'LinkPermissions',
|
49
|
+
:'products' => :'Products1',
|
50
|
+
:'countries' => :'Array<Country>'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# List of attributes with nullable: true
|
55
|
+
def self.openapi_nullable
|
56
|
+
Set.new([
|
57
|
+
:'providers',
|
58
|
+
:'link_permissions',
|
59
|
+
:'products',
|
60
|
+
:'countries'
|
61
|
+
])
|
62
|
+
end
|
63
|
+
|
64
|
+
# List of class defined in allOf (OpenAPI v3)
|
65
|
+
def self.openapi_all_of
|
66
|
+
[
|
67
|
+
:'LinkSessionSettingOverrides'
|
68
|
+
]
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
if (!attributes.is_a?(Hash))
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::Settings` initialize method"
|
76
|
+
end
|
77
|
+
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
80
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::Settings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
82
|
+
end
|
83
|
+
h[k.to_sym] = v
|
84
|
+
}
|
85
|
+
|
86
|
+
if attributes.key?(:'providers')
|
87
|
+
if (value = attributes[:'providers']).is_a?(Array)
|
88
|
+
self.providers = value
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'link_permissions')
|
93
|
+
self.link_permissions = attributes[:'link_permissions']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'products')
|
97
|
+
self.products = attributes[:'products']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'countries')
|
101
|
+
if (value = attributes[:'countries']).is_a?(Array)
|
102
|
+
self.countries = value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
108
|
+
# @return Array for valid properties with the reasons
|
109
|
+
def list_invalid_properties
|
110
|
+
invalid_properties = Array.new
|
111
|
+
invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
120
|
+
# Custom attribute writer method with validation
|
121
|
+
# @param [Object] providers Value to be assigned
|
122
|
+
def providers=(providers)
|
123
|
+
@providers = providers
|
124
|
+
end
|
125
|
+
|
126
|
+
# Custom attribute writer method with validation
|
127
|
+
# @param [Object] countries Value to be assigned
|
128
|
+
def countries=(countries)
|
129
|
+
@countries = countries
|
130
|
+
end
|
131
|
+
|
132
|
+
# Checks equality by comparing each attribute.
|
133
|
+
# @param [Object] Object to be compared
|
134
|
+
def ==(o)
|
135
|
+
return true if self.equal?(o)
|
136
|
+
self.class == o.class &&
|
137
|
+
providers == o.providers &&
|
138
|
+
link_permissions == o.link_permissions &&
|
139
|
+
products == o.products &&
|
140
|
+
countries == o.countries
|
141
|
+
end
|
142
|
+
|
143
|
+
# @see the `==` method
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def eql?(o)
|
146
|
+
self == o
|
147
|
+
end
|
148
|
+
|
149
|
+
# Calculates hash code according to all attributes.
|
150
|
+
# @return [Integer] Hash code
|
151
|
+
def hash
|
152
|
+
[providers, link_permissions, products, countries].hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def self.build_from_hash(attributes)
|
159
|
+
new.build_from_hash(attributes)
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def build_from_hash(attributes)
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
167
|
+
attributes = attributes.transform_keys(&:to_sym)
|
168
|
+
self.class.openapi_types.each_pair do |key, type|
|
169
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
170
|
+
self.send("#{key}=", nil)
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
172
|
+
# check to ensure the input is an array given that the attribute
|
173
|
+
# is documented as an array but the input is not
|
174
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
175
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
176
|
+
end
|
177
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
178
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
self
|
183
|
+
end
|
184
|
+
|
185
|
+
# Deserializes the data based on type
|
186
|
+
# @param string type Data type
|
187
|
+
# @param string value Value to be deserialized
|
188
|
+
# @return [Object] Deserialized data
|
189
|
+
def _deserialize(type, value)
|
190
|
+
case type.to_sym
|
191
|
+
when :Time
|
192
|
+
Time.parse(value)
|
193
|
+
when :Date
|
194
|
+
Date.parse(value)
|
195
|
+
when :String
|
196
|
+
value.to_s
|
197
|
+
when :Integer
|
198
|
+
value.to_i
|
199
|
+
when :Float
|
200
|
+
value.to_f
|
201
|
+
when :Boolean
|
202
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
203
|
+
true
|
204
|
+
else
|
205
|
+
false
|
206
|
+
end
|
207
|
+
when :Object
|
208
|
+
# generic object (usually a Hash), return directly
|
209
|
+
value
|
210
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
211
|
+
inner_type = Regexp.last_match[:inner_type]
|
212
|
+
value.map { |v| _deserialize(inner_type, v) }
|
213
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
214
|
+
k_type = Regexp.last_match[:k_type]
|
215
|
+
v_type = Regexp.last_match[:v_type]
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each do |k, v|
|
218
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
else # model
|
222
|
+
# models (e.g. Pet) or oneOf
|
223
|
+
klass = MoneyKit.const_get(type)
|
224
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# Returns the string representation of the object
|
229
|
+
# @return [String] String presentation of the object
|
230
|
+
def to_s
|
231
|
+
to_hash.to_s
|
232
|
+
end
|
233
|
+
|
234
|
+
# to_body is an alias to to_hash (backward compatibility)
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_body
|
237
|
+
to_hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Returns the object in the form of hash
|
241
|
+
# @return [Hash] Returns the object in the form of hash
|
242
|
+
def to_hash
|
243
|
+
hash = {}
|
244
|
+
self.class.attribute_map.each_pair do |attr, param|
|
245
|
+
value = self.send(attr)
|
246
|
+
if value.nil?
|
247
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
248
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
249
|
+
end
|
250
|
+
|
251
|
+
hash[param] = _to_hash(value)
|
252
|
+
end
|
253
|
+
hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Outputs non-array value in the form of hash
|
257
|
+
# For object, use to_hash. Otherwise, just return the value
|
258
|
+
# @param [Object] value Any valid value
|
259
|
+
# @return [Hash] Returns the value in the form of hash
|
260
|
+
def _to_hash(value)
|
261
|
+
if value.is_a?(Array)
|
262
|
+
value.compact.map { |v| _to_hash(v) }
|
263
|
+
elsif value.is_a?(Hash)
|
264
|
+
{}.tap do |hash|
|
265
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
266
|
+
end
|
267
|
+
elsif value.respond_to? :to_hash
|
268
|
+
value.to_hash
|
269
|
+
else
|
270
|
+
value
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
end
|
275
|
+
|
276
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
=begin
|
2
|
+
#MoneyKit API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.5.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MoneyKit
|
17
|
+
class SupportedVersion
|
18
|
+
N2023_02_18 = "2023-02-18".freeze
|
19
|
+
|
20
|
+
def self.all_vars
|
21
|
+
@all_vars ||= [N2023_02_18].freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the enum from string
|
25
|
+
# @param [String] The enum value in the form of the string
|
26
|
+
# @return [String] The enum value
|
27
|
+
def self.build_from_hash(value)
|
28
|
+
new.build_from_hash(value)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
return value if SupportedVersion.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #SupportedVersion"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,369 @@
|
|
1
|
+
=begin
|
2
|
+
#MoneyKit API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.5.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MoneyKit
|
17
|
+
class Transaction
|
18
|
+
# The unique ID for this transaction.
|
19
|
+
attr_accessor :transaction_id
|
20
|
+
|
21
|
+
# The ID of the account in which this transaction occurred.
|
22
|
+
attr_accessor :account_id
|
23
|
+
|
24
|
+
# The amount of this transaction, denominated in account currency. This amount is always non-negative. The `type` field indicates whether it is entering or leaving the account.
|
25
|
+
attr_accessor :amount
|
26
|
+
|
27
|
+
attr_accessor :type
|
28
|
+
|
29
|
+
# The ISO-4217 currency code of the transaction.
|
30
|
+
attr_accessor :currency
|
31
|
+
|
32
|
+
# The effective (posted) date the transaction, in ISO-8601 format. For pending transactions, this date is when the transaction was initiated.
|
33
|
+
attr_accessor :date
|
34
|
+
|
35
|
+
# A normalized, cleaned transaction description suitable for presentation to the end user. Commonly this will be the merchant or counterparty name.
|
36
|
+
attr_accessor :description
|
37
|
+
|
38
|
+
# The raw transaction description as provided by the institution, where available.
|
39
|
+
attr_accessor :raw_description
|
40
|
+
|
41
|
+
# If true, this transaction is pending or unsettled and has not yet affected the account. Commonly these are credit card transactions, particularly approvals (holds) such as for hotel or restaurant reservations placed in advance where the final amount is still to be determined.
|
42
|
+
attr_accessor :pending
|
43
|
+
|
44
|
+
# The category for this transaction, given as a dotted string indicating a hierarchical categorization. See <a href=/pages/categories>Transaction Categories</a> for the list of possible transaction types.
|
45
|
+
attr_accessor :category
|
46
|
+
|
47
|
+
class EnumAttributeValidator
|
48
|
+
attr_reader :datatype
|
49
|
+
attr_reader :allowable_values
|
50
|
+
|
51
|
+
def initialize(datatype, allowable_values)
|
52
|
+
@allowable_values = allowable_values.map do |value|
|
53
|
+
case datatype.to_s
|
54
|
+
when /Integer/i
|
55
|
+
value.to_i
|
56
|
+
when /Float/i
|
57
|
+
value.to_f
|
58
|
+
else
|
59
|
+
value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def valid?(value)
|
65
|
+
!value || allowable_values.include?(value)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
:'transaction_id' => :'transaction_id',
|
73
|
+
:'account_id' => :'account_id',
|
74
|
+
:'amount' => :'amount',
|
75
|
+
:'type' => :'type',
|
76
|
+
:'currency' => :'currency',
|
77
|
+
:'date' => :'date',
|
78
|
+
:'description' => :'description',
|
79
|
+
:'raw_description' => :'raw_description',
|
80
|
+
:'pending' => :'pending',
|
81
|
+
:'category' => :'category'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Returns all the JSON keys this model knows about
|
86
|
+
def self.acceptable_attributes
|
87
|
+
attribute_map.values
|
88
|
+
end
|
89
|
+
|
90
|
+
# Attribute type mapping.
|
91
|
+
def self.openapi_types
|
92
|
+
{
|
93
|
+
:'transaction_id' => :'String',
|
94
|
+
:'account_id' => :'String',
|
95
|
+
:'amount' => :'String',
|
96
|
+
:'type' => :'TransactionType',
|
97
|
+
:'currency' => :'String',
|
98
|
+
:'date' => :'Date',
|
99
|
+
:'description' => :'String',
|
100
|
+
:'raw_description' => :'String',
|
101
|
+
:'pending' => :'Boolean',
|
102
|
+
:'category' => :'String'
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
# List of attributes with nullable: true
|
107
|
+
def self.openapi_nullable
|
108
|
+
Set.new([
|
109
|
+
:'description',
|
110
|
+
:'raw_description',
|
111
|
+
:'category'
|
112
|
+
])
|
113
|
+
end
|
114
|
+
|
115
|
+
# Initializes the object
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
def initialize(attributes = {})
|
118
|
+
if (!attributes.is_a?(Hash))
|
119
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::Transaction` initialize method"
|
120
|
+
end
|
121
|
+
|
122
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
123
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
124
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
125
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::Transaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
126
|
+
end
|
127
|
+
h[k.to_sym] = v
|
128
|
+
}
|
129
|
+
|
130
|
+
if attributes.key?(:'transaction_id')
|
131
|
+
self.transaction_id = attributes[:'transaction_id']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'account_id')
|
135
|
+
self.account_id = attributes[:'account_id']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'amount')
|
139
|
+
self.amount = attributes[:'amount']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'type')
|
143
|
+
self.type = attributes[:'type']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'currency')
|
147
|
+
self.currency = attributes[:'currency']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.key?(:'date')
|
151
|
+
self.date = attributes[:'date']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'description')
|
155
|
+
self.description = attributes[:'description']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'raw_description')
|
159
|
+
self.raw_description = attributes[:'raw_description']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'pending')
|
163
|
+
self.pending = attributes[:'pending']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'category')
|
167
|
+
self.category = attributes[:'category']
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
172
|
+
# @return Array for valid properties with the reasons
|
173
|
+
def list_invalid_properties
|
174
|
+
invalid_properties = Array.new
|
175
|
+
if @transaction_id.nil?
|
176
|
+
invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.')
|
177
|
+
end
|
178
|
+
|
179
|
+
if @account_id.nil?
|
180
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
181
|
+
end
|
182
|
+
|
183
|
+
if @amount.nil?
|
184
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
185
|
+
end
|
186
|
+
|
187
|
+
if @type.nil?
|
188
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
189
|
+
end
|
190
|
+
|
191
|
+
if @currency.nil?
|
192
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
193
|
+
end
|
194
|
+
|
195
|
+
if @date.nil?
|
196
|
+
invalid_properties.push('invalid value for "date", date cannot be nil.')
|
197
|
+
end
|
198
|
+
|
199
|
+
if @pending.nil?
|
200
|
+
invalid_properties.push('invalid value for "pending", pending cannot be nil.')
|
201
|
+
end
|
202
|
+
|
203
|
+
invalid_properties
|
204
|
+
end
|
205
|
+
|
206
|
+
# Check to see if the all the properties in the model are valid
|
207
|
+
# @return true if the model is valid
|
208
|
+
def valid?
|
209
|
+
return false if @transaction_id.nil?
|
210
|
+
return false if @account_id.nil?
|
211
|
+
return false if @amount.nil?
|
212
|
+
return false if @type.nil?
|
213
|
+
return false if @currency.nil?
|
214
|
+
return false if @date.nil?
|
215
|
+
return false if @pending.nil?
|
216
|
+
true
|
217
|
+
end
|
218
|
+
|
219
|
+
# Checks equality by comparing each attribute.
|
220
|
+
# @param [Object] Object to be compared
|
221
|
+
def ==(o)
|
222
|
+
return true if self.equal?(o)
|
223
|
+
self.class == o.class &&
|
224
|
+
transaction_id == o.transaction_id &&
|
225
|
+
account_id == o.account_id &&
|
226
|
+
amount == o.amount &&
|
227
|
+
type == o.type &&
|
228
|
+
currency == o.currency &&
|
229
|
+
date == o.date &&
|
230
|
+
description == o.description &&
|
231
|
+
raw_description == o.raw_description &&
|
232
|
+
pending == o.pending &&
|
233
|
+
category == o.category
|
234
|
+
end
|
235
|
+
|
236
|
+
# @see the `==` method
|
237
|
+
# @param [Object] Object to be compared
|
238
|
+
def eql?(o)
|
239
|
+
self == o
|
240
|
+
end
|
241
|
+
|
242
|
+
# Calculates hash code according to all attributes.
|
243
|
+
# @return [Integer] Hash code
|
244
|
+
def hash
|
245
|
+
[transaction_id, account_id, amount, type, currency, date, description, raw_description, pending, category].hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Builds the object from hash
|
249
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
250
|
+
# @return [Object] Returns the model itself
|
251
|
+
def self.build_from_hash(attributes)
|
252
|
+
new.build_from_hash(attributes)
|
253
|
+
end
|
254
|
+
|
255
|
+
# Builds the object from hash
|
256
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
257
|
+
# @return [Object] Returns the model itself
|
258
|
+
def build_from_hash(attributes)
|
259
|
+
return nil unless attributes.is_a?(Hash)
|
260
|
+
attributes = attributes.transform_keys(&:to_sym)
|
261
|
+
self.class.openapi_types.each_pair do |key, type|
|
262
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
263
|
+
self.send("#{key}=", nil)
|
264
|
+
elsif type =~ /\AArray<(.*)>/i
|
265
|
+
# check to ensure the input is an array given that the attribute
|
266
|
+
# is documented as an array but the input is not
|
267
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
268
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
269
|
+
end
|
270
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
271
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
self
|
276
|
+
end
|
277
|
+
|
278
|
+
# Deserializes the data based on type
|
279
|
+
# @param string type Data type
|
280
|
+
# @param string value Value to be deserialized
|
281
|
+
# @return [Object] Deserialized data
|
282
|
+
def _deserialize(type, value)
|
283
|
+
case type.to_sym
|
284
|
+
when :Time
|
285
|
+
Time.parse(value)
|
286
|
+
when :Date
|
287
|
+
Date.parse(value)
|
288
|
+
when :String
|
289
|
+
value.to_s
|
290
|
+
when :Integer
|
291
|
+
value.to_i
|
292
|
+
when :Float
|
293
|
+
value.to_f
|
294
|
+
when :Boolean
|
295
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
296
|
+
true
|
297
|
+
else
|
298
|
+
false
|
299
|
+
end
|
300
|
+
when :Object
|
301
|
+
# generic object (usually a Hash), return directly
|
302
|
+
value
|
303
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
304
|
+
inner_type = Regexp.last_match[:inner_type]
|
305
|
+
value.map { |v| _deserialize(inner_type, v) }
|
306
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
307
|
+
k_type = Regexp.last_match[:k_type]
|
308
|
+
v_type = Regexp.last_match[:v_type]
|
309
|
+
{}.tap do |hash|
|
310
|
+
value.each do |k, v|
|
311
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
312
|
+
end
|
313
|
+
end
|
314
|
+
else # model
|
315
|
+
# models (e.g. Pet) or oneOf
|
316
|
+
klass = MoneyKit.const_get(type)
|
317
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
# Returns the string representation of the object
|
322
|
+
# @return [String] String presentation of the object
|
323
|
+
def to_s
|
324
|
+
to_hash.to_s
|
325
|
+
end
|
326
|
+
|
327
|
+
# to_body is an alias to to_hash (backward compatibility)
|
328
|
+
# @return [Hash] Returns the object in the form of hash
|
329
|
+
def to_body
|
330
|
+
to_hash
|
331
|
+
end
|
332
|
+
|
333
|
+
# Returns the object in the form of hash
|
334
|
+
# @return [Hash] Returns the object in the form of hash
|
335
|
+
def to_hash
|
336
|
+
hash = {}
|
337
|
+
self.class.attribute_map.each_pair do |attr, param|
|
338
|
+
value = self.send(attr)
|
339
|
+
if value.nil?
|
340
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
341
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
342
|
+
end
|
343
|
+
|
344
|
+
hash[param] = _to_hash(value)
|
345
|
+
end
|
346
|
+
hash
|
347
|
+
end
|
348
|
+
|
349
|
+
# Outputs non-array value in the form of hash
|
350
|
+
# For object, use to_hash. Otherwise, just return the value
|
351
|
+
# @param [Object] value Any valid value
|
352
|
+
# @return [Hash] Returns the value in the form of hash
|
353
|
+
def _to_hash(value)
|
354
|
+
if value.is_a?(Array)
|
355
|
+
value.compact.map { |v| _to_hash(v) }
|
356
|
+
elsif value.is_a?(Hash)
|
357
|
+
{}.tap do |hash|
|
358
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
359
|
+
end
|
360
|
+
elsif value.respond_to? :to_hash
|
361
|
+
value.to_hash
|
362
|
+
else
|
363
|
+
value
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
end
|
368
|
+
|
369
|
+
end
|