moneykit 0.0.1

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