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,292 @@
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
+ # Details about your end user. These details are used to improve conversion and streamline the linking flow, and to support the MoneyID system, which provides enhanced debugging and improved privacy controls for your end user.
18
+ class CustomerUser
19
+ # Your own unique ID for this user. Typically this will be a UUID or primary key from your application.
20
+ attr_accessor :id
21
+
22
+ attr_accessor :email
23
+
24
+ attr_accessor :phone
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'email' => :'email',
31
+ :'phone' => :'phone'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'id' => :'String',
44
+ :'email' => :'Email1',
45
+ :'phone' => :'Phone'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'email',
53
+ :'phone'
54
+ ])
55
+ end
56
+
57
+ # List of class defined in allOf (OpenAPI v3)
58
+ def self.openapi_all_of
59
+ [
60
+ :'LinkSessionCustomerUser'
61
+ ]
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::CustomerUser` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::CustomerUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'id')
80
+ self.id = attributes[:'id']
81
+ end
82
+
83
+ if attributes.key?(:'email')
84
+ self.email = attributes[:'email']
85
+ end
86
+
87
+ if attributes.key?(:'phone')
88
+ self.phone = attributes[:'phone']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ if @id.nil?
97
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
98
+ end
99
+
100
+ if @id.to_s.length > 150
101
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 150.')
102
+ end
103
+
104
+ if @id.to_s.length < 4
105
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 4.')
106
+ end
107
+
108
+ pattern = Regexp.new(/^[a-zA-Z0-9-_]+$/)
109
+ if @id !~ pattern
110
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ return false if @id.nil?
120
+ return false if @id.to_s.length > 150
121
+ return false if @id.to_s.length < 4
122
+ return false if @id !~ Regexp.new(/^[a-zA-Z0-9-_]+$/)
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] id Value to be assigned
128
+ def id=(id)
129
+ if id.nil?
130
+ fail ArgumentError, 'id cannot be nil'
131
+ end
132
+
133
+ if id.to_s.length > 150
134
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 150.'
135
+ end
136
+
137
+ if id.to_s.length < 4
138
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 4.'
139
+ end
140
+
141
+ pattern = Regexp.new(/^[a-zA-Z0-9-_]+$/)
142
+ if id !~ pattern
143
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
144
+ end
145
+
146
+ @id = id
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ id == o.id &&
155
+ email == o.email &&
156
+ phone == o.phone
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [id, email, phone].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
186
+ self.send("#{key}=", nil)
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
191
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
192
+ end
193
+ elsif !attributes[self.class.attribute_map[key]].nil?
194
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
195
+ end
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :Time
208
+ Time.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ # models (e.g. Pet) or oneOf
239
+ klass = MoneyKit.const_get(type)
240
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+
292
+ end
@@ -0,0 +1,255 @@
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 EftNumber
18
+ # The account number.
19
+ attr_accessor :account_number
20
+
21
+ # The institution number.
22
+ attr_accessor :institution_number
23
+
24
+ # The branch number.
25
+ attr_accessor :branch_number
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'account_number' => :'account_number',
31
+ :'institution_number' => :'institution_number',
32
+ :'branch_number' => :'branch_number'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'account_number' => :'String',
45
+ :'institution_number' => :'String',
46
+ :'branch_number' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::EftNumber` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::EftNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'account_number')
72
+ self.account_number = attributes[:'account_number']
73
+ end
74
+
75
+ if attributes.key?(:'institution_number')
76
+ self.institution_number = attributes[:'institution_number']
77
+ end
78
+
79
+ if attributes.key?(:'branch_number')
80
+ self.branch_number = attributes[:'branch_number']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if @account_number.nil?
89
+ invalid_properties.push('invalid value for "account_number", account_number cannot be nil.')
90
+ end
91
+
92
+ if @institution_number.nil?
93
+ invalid_properties.push('invalid value for "institution_number", institution_number cannot be nil.')
94
+ end
95
+
96
+ if @branch_number.nil?
97
+ invalid_properties.push('invalid value for "branch_number", branch_number cannot be nil.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if @account_number.nil?
107
+ return false if @institution_number.nil?
108
+ return false if @branch_number.nil?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ account_number == o.account_number &&
118
+ institution_number == o.institution_number &&
119
+ branch_number == o.branch_number
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [account_number, institution_number, branch_number].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ self.class.openapi_types.each_pair do |key, type|
148
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
149
+ self.send("#{key}=", nil)
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = MoneyKit.const_get(type)
203
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end