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,225 @@
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 ExchangeTokenRequest
18
+ # The token returned to your front end by MoneyLink's onSuccess callback.
19
+ attr_accessor :exchangeable_token
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'exchangeable_token' => :'exchangeable_token'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'exchangeable_token' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::ExchangeTokenRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::ExchangeTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'exchangeable_token')
62
+ self.exchangeable_token = attributes[:'exchangeable_token']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @exchangeable_token.nil?
71
+ invalid_properties.push('invalid value for "exchangeable_token", exchangeable_token cannot be nil.')
72
+ end
73
+
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @exchangeable_token.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ exchangeable_token == o.exchangeable_token
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ def hash
101
+ [exchangeable_token].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ self.class.openapi_types.each_pair do |key, type|
118
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
119
+ self.send("#{key}=", nil)
120
+ elsif type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :Time
141
+ Time.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :Boolean
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ # models (e.g. Pet) or oneOf
172
+ klass = MoneyKit.const_get(type)
173
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+
225
+ end
@@ -0,0 +1,239 @@
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 ExchangeTokenResponse
18
+ # The unique ID associated with this link.
19
+ attr_accessor :link_id
20
+
21
+ attr_accessor :link
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'link_id' => :'link_id',
27
+ :'link' => :'link'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'link_id' => :'String',
40
+ :'link' => :'Link'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::ExchangeTokenResponse` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::ExchangeTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'link_id')
66
+ self.link_id = attributes[:'link_id']
67
+ end
68
+
69
+ if attributes.key?(:'link')
70
+ self.link = attributes[:'link']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @link_id.nil?
79
+ invalid_properties.push('invalid value for "link_id", link_id cannot be nil.')
80
+ end
81
+
82
+ if @link.nil?
83
+ invalid_properties.push('invalid value for "link", link cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @link_id.nil?
93
+ return false if @link.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ link_id == o.link_id &&
103
+ link == o.link
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [link_id, link].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = MoneyKit.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -0,0 +1,256 @@
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
+ # MoneyKit API access token.
18
+ class GenerateAccessTokenResponse
19
+ # Short-lived access token.
20
+ attr_accessor :access_token
21
+
22
+ # Always \"bearer\".
23
+ attr_accessor :token_type
24
+
25
+ # How long until `access_token` expires in seconds.
26
+ attr_accessor :expires_in
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'access_token' => :'access_token',
32
+ :'token_type' => :'token_type',
33
+ :'expires_in' => :'expires_in'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'access_token' => :'String',
46
+ :'token_type' => :'String',
47
+ :'expires_in' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::GenerateAccessTokenResponse` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::GenerateAccessTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'access_token')
73
+ self.access_token = attributes[:'access_token']
74
+ end
75
+
76
+ if attributes.key?(:'token_type')
77
+ self.token_type = attributes[:'token_type']
78
+ end
79
+
80
+ if attributes.key?(:'expires_in')
81
+ self.expires_in = attributes[:'expires_in']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if @access_token.nil?
90
+ invalid_properties.push('invalid value for "access_token", access_token cannot be nil.')
91
+ end
92
+
93
+ if @token_type.nil?
94
+ invalid_properties.push('invalid value for "token_type", token_type cannot be nil.')
95
+ end
96
+
97
+ if @expires_in.nil?
98
+ invalid_properties.push('invalid value for "expires_in", expires_in cannot be nil.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return false if @access_token.nil?
108
+ return false if @token_type.nil?
109
+ return false if @expires_in.nil?
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ access_token == o.access_token &&
119
+ token_type == o.token_type &&
120
+ expires_in == o.expires_in
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [access_token, token_type, expires_in].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
150
+ self.send("#{key}=", nil)
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ # models (e.g. Pet) or oneOf
203
+ klass = MoneyKit.const_get(type)
204
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end