firefly-iii-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +349 -0
  4. data/Rakefile +10 -0
  5. data/docs/AboutApi.md +143 -0
  6. data/docs/Account.md +70 -0
  7. data/docs/AccountArray.md +20 -0
  8. data/docs/AccountRead.md +22 -0
  9. data/docs/AccountSingle.md +18 -0
  10. data/docs/AccountTypeFilter.md +15 -0
  11. data/docs/AccountTypeProperty.md +15 -0
  12. data/docs/AccountsApi.md +531 -0
  13. data/docs/Attachment.md +44 -0
  14. data/docs/AttachmentArray.md +20 -0
  15. data/docs/AttachmentRead.md +24 -0
  16. data/docs/AttachmentSingle.md +18 -0
  17. data/docs/AttachmentsApi.md +510 -0
  18. data/docs/AvailableBudget.md +38 -0
  19. data/docs/AvailableBudgetArray.md +20 -0
  20. data/docs/AvailableBudgetRead.md +22 -0
  21. data/docs/AvailableBudgetSingle.md +18 -0
  22. data/docs/AvailableBudgetsApi.md +369 -0
  23. data/docs/BasicSummaryEntry.md +36 -0
  24. data/docs/Bill.md +50 -0
  25. data/docs/BillArray.md +20 -0
  26. data/docs/BillPaidDates.md +22 -0
  27. data/docs/BillRead.md +22 -0
  28. data/docs/BillSingle.md +18 -0
  29. data/docs/BillsApi.md +600 -0
  30. data/docs/Budget.md +28 -0
  31. data/docs/BudgetArray.md +20 -0
  32. data/docs/BudgetLimit.md +38 -0
  33. data/docs/BudgetLimitArray.md +20 -0
  34. data/docs/BudgetLimitRead.md +22 -0
  35. data/docs/BudgetLimitSingle.md +18 -0
  36. data/docs/BudgetRead.md +22 -0
  37. data/docs/BudgetSingle.md +18 -0
  38. data/docs/BudgetSpent.md +26 -0
  39. data/docs/BudgetsApi.md +897 -0
  40. data/docs/CategoriesApi.md +446 -0
  41. data/docs/Category.md +26 -0
  42. data/docs/CategoryArray.md +20 -0
  43. data/docs/CategoryEarned.md +30 -0
  44. data/docs/CategoryRead.md +22 -0
  45. data/docs/CategorySingle.md +18 -0
  46. data/docs/CategorySpent.md +30 -0
  47. data/docs/ChartDataPoint.md +18 -0
  48. data/docs/ChartDataSet.md +32 -0
  49. data/docs/ChartsApi.md +374 -0
  50. data/docs/ConfigurationApi.md +148 -0
  51. data/docs/ConfigurationUpdate.md +18 -0
  52. data/docs/CurrenciesApi.md +1198 -0
  53. data/docs/Currency.md +32 -0
  54. data/docs/CurrencyArray.md +22 -0
  55. data/docs/CurrencyExchangeRatesApi.md +86 -0
  56. data/docs/CurrencyRead.md +22 -0
  57. data/docs/CurrencySingle.md +18 -0
  58. data/docs/ExchangeRate.md +22 -0
  59. data/docs/ExchangeRateArray.md +22 -0
  60. data/docs/ExchangeRateAttributes.md +44 -0
  61. data/docs/ImportApi.md +232 -0
  62. data/docs/ImportJob.md +22 -0
  63. data/docs/ImportJobArray.md +22 -0
  64. data/docs/ImportJobAttributes.md +42 -0
  65. data/docs/ImportJobSingle.md +18 -0
  66. data/docs/LinkType.md +26 -0
  67. data/docs/LinkTypeArray.md +22 -0
  68. data/docs/LinkTypeRead.md +24 -0
  69. data/docs/LinkTypeSingle.md +18 -0
  70. data/docs/LinksApi.md +804 -0
  71. data/docs/Meta.md +18 -0
  72. data/docs/MetaPagination.md +26 -0
  73. data/docs/ObjectLink.md +20 -0
  74. data/docs/ObjectLink0.md +20 -0
  75. data/docs/PageLink.md +22 -0
  76. data/docs/PiggyBank.md +54 -0
  77. data/docs/PiggyBankArray.md +22 -0
  78. data/docs/PiggyBankEvent.md +24 -0
  79. data/docs/PiggyBankEventArray.md +22 -0
  80. data/docs/PiggyBankEventAttributes.md +34 -0
  81. data/docs/PiggyBankRead.md +24 -0
  82. data/docs/PiggyBankSingle.md +18 -0
  83. data/docs/PiggyBanksApi.md +440 -0
  84. data/docs/Preference.md +24 -0
  85. data/docs/PreferenceArray.md +22 -0
  86. data/docs/PreferenceRead.md +22 -0
  87. data/docs/PreferenceSingle.md +18 -0
  88. data/docs/PreferencesApi.md +224 -0
  89. data/docs/Recurrence.md +45 -0
  90. data/docs/RecurrenceArray.md +22 -0
  91. data/docs/RecurrenceRead.md +24 -0
  92. data/docs/RecurrenceRepetition.md +34 -0
  93. data/docs/RecurrenceSingle.md +18 -0
  94. data/docs/RecurrenceTransaction.md +68 -0
  95. data/docs/RecurrencesApi.md +513 -0
  96. data/docs/Rule.md +42 -0
  97. data/docs/RuleAction.md +32 -0
  98. data/docs/RuleArray.md +22 -0
  99. data/docs/RuleGroup.md +28 -0
  100. data/docs/RuleGroupArray.md +22 -0
  101. data/docs/RuleGroupRead.md +24 -0
  102. data/docs/RuleGroupSingle.md +18 -0
  103. data/docs/RuleGroupsApi.md +603 -0
  104. data/docs/RuleRead.md +24 -0
  105. data/docs/RuleSingle.md +18 -0
  106. data/docs/RuleTrigger.md +32 -0
  107. data/docs/RulesApi.md +528 -0
  108. data/docs/SummaryApi.md +84 -0
  109. data/docs/SystemConfiguration.md +18 -0
  110. data/docs/SystemConfigurationData.md +24 -0
  111. data/docs/SystemInfo.md +18 -0
  112. data/docs/SystemInfoData.md +26 -0
  113. data/docs/TagArray.md +22 -0
  114. data/docs/TagCloud.md +18 -0
  115. data/docs/TagCloudTag.md +24 -0
  116. data/docs/TagModel.md +34 -0
  117. data/docs/TagRead.md +24 -0
  118. data/docs/TagSingle.md +18 -0
  119. data/docs/TagsApi.md +523 -0
  120. data/docs/Transaction.md +26 -0
  121. data/docs/TransactionArray.md +22 -0
  122. data/docs/TransactionLink.md +30 -0
  123. data/docs/TransactionLinkArray.md +22 -0
  124. data/docs/TransactionLinkRead.md +24 -0
  125. data/docs/TransactionLinkSingle.md +18 -0
  126. data/docs/TransactionRead.md +24 -0
  127. data/docs/TransactionSingle.md +18 -0
  128. data/docs/TransactionSplit.md +128 -0
  129. data/docs/TransactionTypeFilter.md +15 -0
  130. data/docs/TransactionsApi.md +592 -0
  131. data/docs/User.md +28 -0
  132. data/docs/UserArray.md +22 -0
  133. data/docs/UserRead.md +24 -0
  134. data/docs/UserSingle.md +18 -0
  135. data/docs/UsersApi.md +365 -0
  136. data/docs/ValidationError.md +20 -0
  137. data/docs/ValidationErrorErrors.md +20 -0
  138. data/firefly-iii-client.gemspec +39 -0
  139. data/git_push.sh +58 -0
  140. data/lib/firefly_iii_client.rb +172 -0
  141. data/lib/firefly_iii_client/api/about_api.rb +136 -0
  142. data/lib/firefly_iii_client/api/accounts_api.rb +495 -0
  143. data/lib/firefly_iii_client/api/attachments_api.rb +470 -0
  144. data/lib/firefly_iii_client/api/available_budgets_api.rb +348 -0
  145. data/lib/firefly_iii_client/api/bills_api.rb +555 -0
  146. data/lib/firefly_iii_client/api/budgets_api.rb +866 -0
  147. data/lib/firefly_iii_client/api/categories_api.rb +417 -0
  148. data/lib/firefly_iii_client/api/charts_api.rb +383 -0
  149. data/lib/firefly_iii_client/api/configuration_api.rb +156 -0
  150. data/lib/firefly_iii_client/api/currencies_api.rb +1089 -0
  151. data/lib/firefly_iii_client/api/currency_exchange_rates_api.rb +91 -0
  152. data/lib/firefly_iii_client/api/import_api.rb +220 -0
  153. data/lib/firefly_iii_client/api/links_api.rb +737 -0
  154. data/lib/firefly_iii_client/api/piggy_banks_api.rb +408 -0
  155. data/lib/firefly_iii_client/api/preferences_api.rb +216 -0
  156. data/lib/firefly_iii_client/api/recurrences_api.rb +472 -0
  157. data/lib/firefly_iii_client/api/rule_groups_api.rb +559 -0
  158. data/lib/firefly_iii_client/api/rules_api.rb +493 -0
  159. data/lib/firefly_iii_client/api/summary_api.rb +96 -0
  160. data/lib/firefly_iii_client/api/tags_api.rb +491 -0
  161. data/lib/firefly_iii_client/api/transactions_api.rb +546 -0
  162. data/lib/firefly_iii_client/api/users_api.rb +342 -0
  163. data/lib/firefly_iii_client/api_client.rb +390 -0
  164. data/lib/firefly_iii_client/api_error.rb +57 -0
  165. data/lib/firefly_iii_client/configuration.rb +277 -0
  166. data/lib/firefly_iii_client/models/account.rb +564 -0
  167. data/lib/firefly_iii_client/models/account_array.rb +229 -0
  168. data/lib/firefly_iii_client/models/account_read.rb +237 -0
  169. data/lib/firefly_iii_client/models/account_single.rb +218 -0
  170. data/lib/firefly_iii_client/models/account_type_filter.rb +56 -0
  171. data/lib/firefly_iii_client/models/account_type_property.rb +47 -0
  172. data/lib/firefly_iii_client/models/attachment.rb +401 -0
  173. data/lib/firefly_iii_client/models/attachment_array.rb +229 -0
  174. data/lib/firefly_iii_client/models/attachment_read.rb +246 -0
  175. data/lib/firefly_iii_client/models/attachment_single.rb +218 -0
  176. data/lib/firefly_iii_client/models/available_budget.rb +331 -0
  177. data/lib/firefly_iii_client/models/available_budget_array.rb +229 -0
  178. data/lib/firefly_iii_client/models/available_budget_read.rb +237 -0
  179. data/lib/firefly_iii_client/models/available_budget_single.rb +218 -0
  180. data/lib/firefly_iii_client/models/basic_summary_entry.rb +307 -0
  181. data/lib/firefly_iii_client/models/bill.rb +433 -0
  182. data/lib/firefly_iii_client/models/bill_array.rb +229 -0
  183. data/lib/firefly_iii_client/models/bill_paid_dates.rb +239 -0
  184. data/lib/firefly_iii_client/models/bill_read.rb +237 -0
  185. data/lib/firefly_iii_client/models/bill_single.rb +218 -0
  186. data/lib/firefly_iii_client/models/budget.rb +271 -0
  187. data/lib/firefly_iii_client/models/budget_array.rb +229 -0
  188. data/lib/firefly_iii_client/models/budget_limit.rb +335 -0
  189. data/lib/firefly_iii_client/models/budget_limit_array.rb +229 -0
  190. data/lib/firefly_iii_client/models/budget_limit_read.rb +237 -0
  191. data/lib/firefly_iii_client/models/budget_limit_single.rb +218 -0
  192. data/lib/firefly_iii_client/models/budget_read.rb +237 -0
  193. data/lib/firefly_iii_client/models/budget_single.rb +218 -0
  194. data/lib/firefly_iii_client/models/budget_spent.rb +256 -0
  195. data/lib/firefly_iii_client/models/category.rb +263 -0
  196. data/lib/firefly_iii_client/models/category_array.rb +229 -0
  197. data/lib/firefly_iii_client/models/category_earned.rb +274 -0
  198. data/lib/firefly_iii_client/models/category_read.rb +237 -0
  199. data/lib/firefly_iii_client/models/category_single.rb +218 -0
  200. data/lib/firefly_iii_client/models/category_spent.rb +274 -0
  201. data/lib/firefly_iii_client/models/chart_data_point.rb +219 -0
  202. data/lib/firefly_iii_client/models/chart_data_set.rb +289 -0
  203. data/lib/firefly_iii_client/models/configuration_update.rb +224 -0
  204. data/lib/firefly_iii_client/models/currency.rb +299 -0
  205. data/lib/firefly_iii_client/models/currency_array.rb +238 -0
  206. data/lib/firefly_iii_client/models/currency_read.rb +237 -0
  207. data/lib/firefly_iii_client/models/currency_single.rb +218 -0
  208. data/lib/firefly_iii_client/models/exchange_rate.rb +237 -0
  209. data/lib/firefly_iii_client/models/exchange_rate_array.rb +238 -0
  210. data/lib/firefly_iii_client/models/exchange_rate_attributes.rb +336 -0
  211. data/lib/firefly_iii_client/models/import_job.rb +237 -0
  212. data/lib/firefly_iii_client/models/import_job_array.rb +238 -0
  213. data/lib/firefly_iii_client/models/import_job_attributes.rb +337 -0
  214. data/lib/firefly_iii_client/models/import_job_single.rb +218 -0
  215. data/lib/firefly_iii_client/models/link_type.rb +260 -0
  216. data/lib/firefly_iii_client/models/link_type_array.rb +238 -0
  217. data/lib/firefly_iii_client/models/link_type_read.rb +246 -0
  218. data/lib/firefly_iii_client/models/link_type_single.rb +218 -0
  219. data/lib/firefly_iii_client/models/meta.rb +218 -0
  220. data/lib/firefly_iii_client/models/meta_pagination.rb +254 -0
  221. data/lib/firefly_iii_client/models/object_link.rb +227 -0
  222. data/lib/firefly_iii_client/models/object_link0.rb +227 -0
  223. data/lib/firefly_iii_client/models/page_link.rb +236 -0
  224. data/lib/firefly_iii_client/models/piggy_bank.rb +400 -0
  225. data/lib/firefly_iii_client/models/piggy_bank_array.rb +238 -0
  226. data/lib/firefly_iii_client/models/piggy_bank_event.rb +246 -0
  227. data/lib/firefly_iii_client/models/piggy_bank_event_array.rb +238 -0
  228. data/lib/firefly_iii_client/models/piggy_bank_event_attributes.rb +291 -0
  229. data/lib/firefly_iii_client/models/piggy_bank_read.rb +246 -0
  230. data/lib/firefly_iii_client/models/piggy_bank_single.rb +218 -0
  231. data/lib/firefly_iii_client/models/preference.rb +251 -0
  232. data/lib/firefly_iii_client/models/preference_array.rb +238 -0
  233. data/lib/firefly_iii_client/models/preference_read.rb +237 -0
  234. data/lib/firefly_iii_client/models/preference_single.rb +218 -0
  235. data/lib/firefly_iii_client/models/recurrence.rb +395 -0
  236. data/lib/firefly_iii_client/models/recurrence_array.rb +238 -0
  237. data/lib/firefly_iii_client/models/recurrence_read.rb +246 -0
  238. data/lib/firefly_iii_client/models/recurrence_repetition.rb +342 -0
  239. data/lib/firefly_iii_client/models/recurrence_single.rb +218 -0
  240. data/lib/firefly_iii_client/models/recurrence_transaction.rb +483 -0
  241. data/lib/firefly_iii_client/models/rule.rb +395 -0
  242. data/lib/firefly_iii_client/models/rule_action.rb +326 -0
  243. data/lib/firefly_iii_client/models/rule_array.rb +238 -0
  244. data/lib/firefly_iii_client/models/rule_group.rb +268 -0
  245. data/lib/firefly_iii_client/models/rule_group_array.rb +238 -0
  246. data/lib/firefly_iii_client/models/rule_group_read.rb +246 -0
  247. data/lib/firefly_iii_client/models/rule_group_single.rb +218 -0
  248. data/lib/firefly_iii_client/models/rule_read.rb +246 -0
  249. data/lib/firefly_iii_client/models/rule_single.rb +218 -0
  250. data/lib/firefly_iii_client/models/rule_trigger.rb +330 -0
  251. data/lib/firefly_iii_client/models/system_configuration.rb +218 -0
  252. data/lib/firefly_iii_client/models/system_configuration_data.rb +248 -0
  253. data/lib/firefly_iii_client/models/system_info.rb +223 -0
  254. data/lib/firefly_iii_client/models/system_info_data.rb +279 -0
  255. data/lib/firefly_iii_client/models/tag_array.rb +238 -0
  256. data/lib/firefly_iii_client/models/tag_cloud.rb +220 -0
  257. data/lib/firefly_iii_client/models/tag_cloud_tag.rb +249 -0
  258. data/lib/firefly_iii_client/models/tag_model.rb +295 -0
  259. data/lib/firefly_iii_client/models/tag_read.rb +246 -0
  260. data/lib/firefly_iii_client/models/tag_single.rb +218 -0
  261. data/lib/firefly_iii_client/models/transaction.rb +263 -0
  262. data/lib/firefly_iii_client/models/transaction_array.rb +238 -0
  263. data/lib/firefly_iii_client/models/transaction_link.rb +292 -0
  264. data/lib/firefly_iii_client/models/transaction_link_array.rb +238 -0
  265. data/lib/firefly_iii_client/models/transaction_link_read.rb +246 -0
  266. data/lib/firefly_iii_client/models/transaction_link_single.rb +218 -0
  267. data/lib/firefly_iii_client/models/transaction_read.rb +246 -0
  268. data/lib/firefly_iii_client/models/transaction_single.rb +218 -0
  269. data/lib/firefly_iii_client/models/transaction_split.rb +850 -0
  270. data/lib/firefly_iii_client/models/transaction_type_filter.rb +49 -0
  271. data/lib/firefly_iii_client/models/user.rb +320 -0
  272. data/lib/firefly_iii_client/models/user_array.rb +238 -0
  273. data/lib/firefly_iii_client/models/user_read.rb +246 -0
  274. data/lib/firefly_iii_client/models/user_single.rb +218 -0
  275. data/lib/firefly_iii_client/models/validation_error.rb +227 -0
  276. data/lib/firefly_iii_client/models/validation_error_errors.rb +231 -0
  277. data/lib/firefly_iii_client/version.rb +15 -0
  278. data/spec/api/about_api_spec.rb +57 -0
  279. data/spec/api/accounts_api_spec.rb +129 -0
  280. data/spec/api/attachments_api_spec.rb +121 -0
  281. data/spec/api/available_budgets_api_spec.rb +98 -0
  282. data/spec/api/bills_api_spec.rb +140 -0
  283. data/spec/api/budgets_api_spec.rb +194 -0
  284. data/spec/api/categories_api_spec.rb +112 -0
  285. data/spec/api/charts_api_spec.rb +101 -0
  286. data/spec/api/configuration_api_spec.rb +59 -0
  287. data/spec/api/currencies_api_spec.rb +246 -0
  288. data/spec/api/currency_exchange_rates_api_spec.rb +50 -0
  289. data/spec/api/import_api_spec.rb +75 -0
  290. data/spec/api/links_api_spec.rb +173 -0
  291. data/spec/api/piggy_banks_api_spec.rb +109 -0
  292. data/spec/api/preferences_api_spec.rb +72 -0
  293. data/spec/api/recurrences_api_spec.rb +123 -0
  294. data/spec/api/rule_groups_api_spec.rb +142 -0
  295. data/spec/api/rules_api_spec.rb +129 -0
  296. data/spec/api/summary_api_spec.rb +49 -0
  297. data/spec/api/tags_api_spec.rb +126 -0
  298. data/spec/api/transactions_api_spec.rb +137 -0
  299. data/spec/api/users_api_spec.rb +96 -0
  300. data/spec/api_client_spec.rb +226 -0
  301. data/spec/configuration_spec.rb +42 -0
  302. data/spec/models/account_array_spec.rb +40 -0
  303. data/spec/models/account_read_spec.rb +46 -0
  304. data/spec/models/account_single_spec.rb +34 -0
  305. data/spec/models/account_spec.rb +210 -0
  306. data/spec/models/account_type_filter_spec.rb +28 -0
  307. data/spec/models/account_type_property_spec.rb +28 -0
  308. data/spec/models/attachment_array_spec.rb +40 -0
  309. data/spec/models/attachment_read_spec.rb +52 -0
  310. data/spec/models/attachment_single_spec.rb +34 -0
  311. data/spec/models/attachment_spec.rb +120 -0
  312. data/spec/models/available_budget_array_spec.rb +40 -0
  313. data/spec/models/available_budget_read_spec.rb +46 -0
  314. data/spec/models/available_budget_single_spec.rb +34 -0
  315. data/spec/models/available_budget_spec.rb +94 -0
  316. data/spec/models/basic_summary_entry_spec.rb +88 -0
  317. data/spec/models/bill_array_spec.rb +40 -0
  318. data/spec/models/bill_paid_dates_spec.rb +46 -0
  319. data/spec/models/bill_read_spec.rb +46 -0
  320. data/spec/models/bill_single_spec.rb +34 -0
  321. data/spec/models/bill_spec.rb +134 -0
  322. data/spec/models/budget_array_spec.rb +40 -0
  323. data/spec/models/budget_limit_array_spec.rb +40 -0
  324. data/spec/models/budget_limit_read_spec.rb +46 -0
  325. data/spec/models/budget_limit_single_spec.rb +34 -0
  326. data/spec/models/budget_limit_spec.rb +94 -0
  327. data/spec/models/budget_read_spec.rb +46 -0
  328. data/spec/models/budget_single_spec.rb +34 -0
  329. data/spec/models/budget_spec.rb +64 -0
  330. data/spec/models/budget_spent_spec.rb +58 -0
  331. data/spec/models/category_array_spec.rb +40 -0
  332. data/spec/models/category_earned_spec.rb +70 -0
  333. data/spec/models/category_read_spec.rb +46 -0
  334. data/spec/models/category_single_spec.rb +34 -0
  335. data/spec/models/category_spec.rb +58 -0
  336. data/spec/models/category_spent_spec.rb +70 -0
  337. data/spec/models/chart_data_point_spec.rb +34 -0
  338. data/spec/models/chart_data_set_spec.rb +76 -0
  339. data/spec/models/configuration_update_spec.rb +34 -0
  340. data/spec/models/currency_array_spec.rb +46 -0
  341. data/spec/models/currency_read_spec.rb +46 -0
  342. data/spec/models/currency_single_spec.rb +34 -0
  343. data/spec/models/currency_spec.rb +76 -0
  344. data/spec/models/exchange_rate_array_spec.rb +46 -0
  345. data/spec/models/exchange_rate_attributes_spec.rb +112 -0
  346. data/spec/models/exchange_rate_spec.rb +46 -0
  347. data/spec/models/import_job_array_spec.rb +46 -0
  348. data/spec/models/import_job_attributes_spec.rb +106 -0
  349. data/spec/models/import_job_single_spec.rb +34 -0
  350. data/spec/models/import_job_spec.rb +46 -0
  351. data/spec/models/link_type_array_spec.rb +46 -0
  352. data/spec/models/link_type_read_spec.rb +52 -0
  353. data/spec/models/link_type_single_spec.rb +34 -0
  354. data/spec/models/link_type_spec.rb +52 -0
  355. data/spec/models/meta_pagination_spec.rb +58 -0
  356. data/spec/models/meta_spec.rb +34 -0
  357. data/spec/models/object_link0_spec.rb +40 -0
  358. data/spec/models/object_link_spec.rb +40 -0
  359. data/spec/models/page_link_spec.rb +46 -0
  360. data/spec/models/piggy_bank_array_spec.rb +46 -0
  361. data/spec/models/piggy_bank_event_array_spec.rb +46 -0
  362. data/spec/models/piggy_bank_event_attributes_spec.rb +82 -0
  363. data/spec/models/piggy_bank_event_spec.rb +52 -0
  364. data/spec/models/piggy_bank_read_spec.rb +52 -0
  365. data/spec/models/piggy_bank_single_spec.rb +34 -0
  366. data/spec/models/piggy_bank_spec.rb +142 -0
  367. data/spec/models/preference_array_spec.rb +46 -0
  368. data/spec/models/preference_read_spec.rb +46 -0
  369. data/spec/models/preference_single_spec.rb +34 -0
  370. data/spec/models/preference_spec.rb +52 -0
  371. data/spec/models/recurrence_array_spec.rb +46 -0
  372. data/spec/models/recurrence_read_spec.rb +52 -0
  373. data/spec/models/recurrence_repetition_spec.rb +86 -0
  374. data/spec/models/recurrence_single_spec.rb +34 -0
  375. data/spec/models/recurrence_spec.rb +116 -0
  376. data/spec/models/recurrence_transaction_spec.rb +184 -0
  377. data/spec/models/rule_action_spec.rb +80 -0
  378. data/spec/models/rule_array_spec.rb +46 -0
  379. data/spec/models/rule_group_array_spec.rb +46 -0
  380. data/spec/models/rule_group_read_spec.rb +52 -0
  381. data/spec/models/rule_group_single_spec.rb +34 -0
  382. data/spec/models/rule_group_spec.rb +64 -0
  383. data/spec/models/rule_read_spec.rb +52 -0
  384. data/spec/models/rule_single_spec.rb +34 -0
  385. data/spec/models/rule_spec.rb +110 -0
  386. data/spec/models/rule_trigger_spec.rb +80 -0
  387. data/spec/models/system_configuration_data_spec.rb +52 -0
  388. data/spec/models/system_configuration_spec.rb +34 -0
  389. data/spec/models/system_info_data_spec.rb +58 -0
  390. data/spec/models/system_info_spec.rb +34 -0
  391. data/spec/models/tag_array_spec.rb +46 -0
  392. data/spec/models/tag_cloud_spec.rb +34 -0
  393. data/spec/models/tag_cloud_tag_spec.rb +52 -0
  394. data/spec/models/tag_model_spec.rb +76 -0
  395. data/spec/models/tag_read_spec.rb +52 -0
  396. data/spec/models/tag_single_spec.rb +34 -0
  397. data/spec/models/transaction_array_spec.rb +46 -0
  398. data/spec/models/transaction_link_array_spec.rb +46 -0
  399. data/spec/models/transaction_link_read_spec.rb +52 -0
  400. data/spec/models/transaction_link_single_spec.rb +34 -0
  401. data/spec/models/transaction_link_spec.rb +70 -0
  402. data/spec/models/transaction_read_spec.rb +52 -0
  403. data/spec/models/transaction_single_spec.rb +34 -0
  404. data/spec/models/transaction_spec.rb +58 -0
  405. data/spec/models/transaction_split_spec.rb +368 -0
  406. data/spec/models/transaction_type_filter_spec.rb +28 -0
  407. data/spec/models/user_array_spec.rb +46 -0
  408. data/spec/models/user_read_spec.rb +52 -0
  409. data/spec/models/user_single_spec.rb +34 -0
  410. data/spec/models/user_spec.rb +72 -0
  411. data/spec/models/validation_error_errors_spec.rb +40 -0
  412. data/spec/models/validation_error_spec.rb +40 -0
  413. data/spec/spec_helper.rb +111 -0
  414. metadata +495 -0
@@ -0,0 +1,850 @@
1
+ =begin
2
+ #Firefly III API
3
+
4
+ #This is the official documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. This version of the API is live from version v4.7.9 and onwards. You may use the \"Authorize\" button to try the API below.
5
+
6
+ The version of the OpenAPI document: 0.10.4-modified
7
+ Contact: thegrumpydictator@gmail.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FireflyIIIClient
17
+ class TransactionSplit
18
+ # User ID
19
+ attr_accessor :user
20
+
21
+ # ID of the underlying transaction journal. Each transaction consists of a transaction group (see the top ID) and one or more journals making up the splits of the transaction.
22
+ attr_accessor :transaction_journal_id
23
+
24
+ # Type of transaction. expense cannot be written.
25
+ attr_accessor :type
26
+
27
+ # Date of the transaction
28
+ attr_accessor :date
29
+
30
+ # Amount of the transaction.
31
+ attr_accessor :amount
32
+
33
+ # Description of the transaction. Will only be used if more than one split is submitted.
34
+ attr_accessor :description
35
+
36
+ # Order of this entry in the list of transactions.
37
+ attr_accessor :order
38
+
39
+ # Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code.
40
+ attr_accessor :currency_id
41
+
42
+ # Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id.
43
+ attr_accessor :currency_code
44
+
45
+ attr_accessor :currency_symbol
46
+
47
+ attr_accessor :currency_name
48
+
49
+ # Number of decimals used in this currency.
50
+ attr_accessor :currency_decimal_places
51
+
52
+ # The amount in a foreign currency.
53
+ attr_accessor :foreign_amount
54
+
55
+ # Currency ID. Default is null. Is required when you submit a foreign amount.
56
+ attr_accessor :foreign_currency_id
57
+
58
+ # Currency code. Default is NULL. Can be used instead of the foreign_currency_id, but either is required when submitting a foreign amount.
59
+ attr_accessor :foreign_currency_code
60
+
61
+ attr_accessor :foreign_currency_symbol
62
+
63
+ # Number of decimals in the currency
64
+ attr_accessor :foreign_currency_decimal_places
65
+
66
+ # The budget ID for this transaction.
67
+ attr_accessor :budget_id
68
+
69
+ # The name of the budget to be used. If the budget name is unknown, the ID will be used or the value will be ignored.
70
+ attr_accessor :budget_name
71
+
72
+ # The category ID for this transaction.
73
+ attr_accessor :category_id
74
+
75
+ # The name of the category to be used. If the category is unknown, it will be created. If the ID and the name point to different categories, the ID overrules the name.
76
+ attr_accessor :category_name
77
+
78
+ # ID of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account.
79
+ attr_accessor :source_id
80
+
81
+ # Name of the source account. For a withdrawal or a transfer, this must always be an asset account. For deposits, this must be a revenue account. Can be used instead of the source_id. If the transaction is a deposit, the source_name can be filled in freely: the account will be created based on the name.
82
+ attr_accessor :source_name
83
+
84
+ attr_accessor :source_iban
85
+
86
+ attr_accessor :source_type
87
+
88
+ # ID of the destination account. For a deposit or a transfer, this must always be an asset account. For withdrawals this must be an expense account.
89
+ attr_accessor :destination_id
90
+
91
+ # Name of the destination account. You can submit the name instead of the ID. For everything except transfers, the account will be auto-generated if unknown, so submitting a name is enough.
92
+ attr_accessor :destination_name
93
+
94
+ attr_accessor :destination_iban
95
+
96
+ attr_accessor :destination_type
97
+
98
+ # If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user.
99
+ attr_accessor :reconciled
100
+
101
+ # Optional. Use either this or the piggy_bank_name
102
+ attr_accessor :piggy_bank_id
103
+
104
+ # Optional. Use either this or the piggy_bank_id
105
+ attr_accessor :piggy_bank_name
106
+
107
+ # Optional. Use either this or the bill_name
108
+ attr_accessor :bill_id
109
+
110
+ # Optional. Use either this or the bill_id
111
+ attr_accessor :bill_name
112
+
113
+ # Array of tags.
114
+ attr_accessor :tags
115
+
116
+ attr_accessor :notes
117
+
118
+ # Reference to internal reference of other systems.
119
+ attr_accessor :internal_reference
120
+
121
+ # Reference to external ID in other systems.
122
+ attr_accessor :external_id
123
+
124
+ # System generated identifier for original creator of transaction.
125
+ attr_accessor :original_source
126
+
127
+ # Reference to recurrence that made the transaction.
128
+ attr_accessor :recurrence_id
129
+
130
+ # Internal ID of bunq transaction.
131
+ attr_accessor :bunq_payment_id
132
+
133
+ # Hash value of original import transaction (for duplicate detection).
134
+ attr_accessor :import_hash_v2
135
+
136
+ # SEPA Clearing Code
137
+ attr_accessor :sepa_cc
138
+
139
+ # SEPA Opposing Account Identifier
140
+ attr_accessor :sepa_ct_op
141
+
142
+ # SEPA end-to-end Identifier
143
+ attr_accessor :sepa_ct_id
144
+
145
+ # SEPA mandate identifier
146
+ attr_accessor :sepa_db
147
+
148
+ # SEPA Country
149
+ attr_accessor :sepa_country
150
+
151
+ # SEPA External Purpose indicator
152
+ attr_accessor :sepa_ep
153
+
154
+ # SEPA Creditor Identifier
155
+ attr_accessor :sepa_ci
156
+
157
+ # SEPA Batch ID
158
+ attr_accessor :sepa_batch_id
159
+
160
+ attr_accessor :interest_date
161
+
162
+ attr_accessor :book_date
163
+
164
+ attr_accessor :process_date
165
+
166
+ attr_accessor :due_date
167
+
168
+ attr_accessor :payment_date
169
+
170
+ attr_accessor :invoice_date
171
+
172
+ class EnumAttributeValidator
173
+ attr_reader :datatype
174
+ attr_reader :allowable_values
175
+
176
+ def initialize(datatype, allowable_values)
177
+ @allowable_values = allowable_values.map do |value|
178
+ case datatype.to_s
179
+ when /Integer/i
180
+ value.to_i
181
+ when /Float/i
182
+ value.to_f
183
+ else
184
+ value
185
+ end
186
+ end
187
+ end
188
+
189
+ def valid?(value)
190
+ !value || allowable_values.include?(value)
191
+ end
192
+ end
193
+
194
+ # Attribute mapping from ruby-style variable name to JSON key.
195
+ def self.attribute_map
196
+ {
197
+ :'user' => :'user',
198
+ :'transaction_journal_id' => :'transaction_journal_id',
199
+ :'type' => :'type',
200
+ :'date' => :'date',
201
+ :'amount' => :'amount',
202
+ :'description' => :'description',
203
+ :'order' => :'order',
204
+ :'currency_id' => :'currency_id',
205
+ :'currency_code' => :'currency_code',
206
+ :'currency_symbol' => :'currency_symbol',
207
+ :'currency_name' => :'currency_name',
208
+ :'currency_decimal_places' => :'currency_decimal_places',
209
+ :'foreign_amount' => :'foreign_amount',
210
+ :'foreign_currency_id' => :'foreign_currency_id',
211
+ :'foreign_currency_code' => :'foreign_currency_code',
212
+ :'foreign_currency_symbol' => :'foreign_currency_symbol',
213
+ :'foreign_currency_decimal_places' => :'foreign_currency_decimal_places',
214
+ :'budget_id' => :'budget_id',
215
+ :'budget_name' => :'budget_name',
216
+ :'category_id' => :'category_id',
217
+ :'category_name' => :'category_name',
218
+ :'source_id' => :'source_id',
219
+ :'source_name' => :'source_name',
220
+ :'source_iban' => :'source_iban',
221
+ :'source_type' => :'source_type',
222
+ :'destination_id' => :'destination_id',
223
+ :'destination_name' => :'destination_name',
224
+ :'destination_iban' => :'destination_iban',
225
+ :'destination_type' => :'destination_type',
226
+ :'reconciled' => :'reconciled',
227
+ :'piggy_bank_id' => :'piggy_bank_id',
228
+ :'piggy_bank_name' => :'piggy_bank_name',
229
+ :'bill_id' => :'bill_id',
230
+ :'bill_name' => :'bill_name',
231
+ :'tags' => :'tags',
232
+ :'notes' => :'notes',
233
+ :'internal_reference' => :'internal_reference',
234
+ :'external_id' => :'external_id',
235
+ :'original_source' => :'original_source',
236
+ :'recurrence_id' => :'recurrence_id',
237
+ :'bunq_payment_id' => :'bunq_payment_id',
238
+ :'import_hash_v2' => :'import_hash_v2',
239
+ :'sepa_cc' => :'sepa_cc',
240
+ :'sepa_ct_op' => :'sepa_ct_op',
241
+ :'sepa_ct_id' => :'sepa_ct_id',
242
+ :'sepa_db' => :'sepa_db',
243
+ :'sepa_country' => :'sepa_country',
244
+ :'sepa_ep' => :'sepa_ep',
245
+ :'sepa_ci' => :'sepa_ci',
246
+ :'sepa_batch_id' => :'sepa_batch_id',
247
+ :'interest_date' => :'interest_date',
248
+ :'book_date' => :'book_date',
249
+ :'process_date' => :'process_date',
250
+ :'due_date' => :'due_date',
251
+ :'payment_date' => :'payment_date',
252
+ :'invoice_date' => :'invoice_date'
253
+ }
254
+ end
255
+
256
+ # Returns all the JSON keys this model knows about
257
+ def self.acceptable_attributes
258
+ attribute_map.values
259
+ end
260
+
261
+ # Attribute type mapping.
262
+ def self.openapi_types
263
+ {
264
+ :'user' => :'Integer',
265
+ :'transaction_journal_id' => :'Integer',
266
+ :'type' => :'String',
267
+ :'date' => :'Date',
268
+ :'amount' => :'Float',
269
+ :'description' => :'String',
270
+ :'order' => :'Integer',
271
+ :'currency_id' => :'Integer',
272
+ :'currency_code' => :'String',
273
+ :'currency_symbol' => :'String',
274
+ :'currency_name' => :'String',
275
+ :'currency_decimal_places' => :'Integer',
276
+ :'foreign_amount' => :'Float',
277
+ :'foreign_currency_id' => :'Integer',
278
+ :'foreign_currency_code' => :'String',
279
+ :'foreign_currency_symbol' => :'String',
280
+ :'foreign_currency_decimal_places' => :'Integer',
281
+ :'budget_id' => :'Integer',
282
+ :'budget_name' => :'String',
283
+ :'category_id' => :'Integer',
284
+ :'category_name' => :'String',
285
+ :'source_id' => :'Integer',
286
+ :'source_name' => :'String',
287
+ :'source_iban' => :'String',
288
+ :'source_type' => :'AccountTypeProperty',
289
+ :'destination_id' => :'Integer',
290
+ :'destination_name' => :'String',
291
+ :'destination_iban' => :'String',
292
+ :'destination_type' => :'AccountTypeProperty',
293
+ :'reconciled' => :'Boolean',
294
+ :'piggy_bank_id' => :'Integer',
295
+ :'piggy_bank_name' => :'String',
296
+ :'bill_id' => :'Integer',
297
+ :'bill_name' => :'String',
298
+ :'tags' => :'Array<String>',
299
+ :'notes' => :'String',
300
+ :'internal_reference' => :'String',
301
+ :'external_id' => :'String',
302
+ :'original_source' => :'String',
303
+ :'recurrence_id' => :'Integer',
304
+ :'bunq_payment_id' => :'String',
305
+ :'import_hash_v2' => :'String',
306
+ :'sepa_cc' => :'String',
307
+ :'sepa_ct_op' => :'String',
308
+ :'sepa_ct_id' => :'String',
309
+ :'sepa_db' => :'String',
310
+ :'sepa_country' => :'String',
311
+ :'sepa_ep' => :'String',
312
+ :'sepa_ci' => :'String',
313
+ :'sepa_batch_id' => :'String',
314
+ :'interest_date' => :'Date',
315
+ :'book_date' => :'Date',
316
+ :'process_date' => :'Date',
317
+ :'due_date' => :'Date',
318
+ :'payment_date' => :'Date',
319
+ :'invoice_date' => :'Date'
320
+ }
321
+ end
322
+
323
+ # List of attributes with nullable: true
324
+ def self.openapi_nullable
325
+ Set.new([
326
+ :'order',
327
+ :'currency_id',
328
+ :'currency_code',
329
+ :'foreign_amount',
330
+ :'foreign_currency_id',
331
+ :'foreign_currency_code',
332
+ :'foreign_currency_symbol',
333
+ :'foreign_currency_decimal_places',
334
+ :'budget_id',
335
+ :'budget_name',
336
+ :'category_id',
337
+ :'category_name',
338
+ :'source_id',
339
+ :'source_name',
340
+ :'source_iban',
341
+ :'destination_id',
342
+ :'destination_name',
343
+ :'destination_iban',
344
+ :'reconciled',
345
+ :'piggy_bank_id',
346
+ :'piggy_bank_name',
347
+ :'bill_id',
348
+ :'bill_name',
349
+ :'tags',
350
+ :'notes',
351
+ :'internal_reference',
352
+ :'external_id',
353
+ :'original_source',
354
+ :'recurrence_id',
355
+ :'bunq_payment_id',
356
+ :'import_hash_v2',
357
+ :'sepa_cc',
358
+ :'sepa_ct_id',
359
+ :'sepa_db',
360
+ :'sepa_country',
361
+ :'sepa_ep',
362
+ :'sepa_ci',
363
+ :'sepa_batch_id',
364
+ :'interest_date',
365
+ :'book_date',
366
+ :'process_date',
367
+ :'due_date',
368
+ :'payment_date',
369
+ :'invoice_date'
370
+ ])
371
+ end
372
+
373
+ # Initializes the object
374
+ # @param [Hash] attributes Model attributes in the form of hash
375
+ def initialize(attributes = {})
376
+ if (!attributes.is_a?(Hash))
377
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TransactionSplit` initialize method"
378
+ end
379
+
380
+ # check to see if the attribute exists and convert string to symbol for hash key
381
+ attributes = attributes.each_with_object({}) { |(k, v), h|
382
+ if (!self.class.attribute_map.key?(k.to_sym))
383
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TransactionSplit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
384
+ end
385
+ h[k.to_sym] = v
386
+ }
387
+
388
+ if attributes.key?(:'user')
389
+ self.user = attributes[:'user']
390
+ end
391
+
392
+ if attributes.key?(:'transaction_journal_id')
393
+ self.transaction_journal_id = attributes[:'transaction_journal_id']
394
+ end
395
+
396
+ if attributes.key?(:'type')
397
+ self.type = attributes[:'type']
398
+ end
399
+
400
+ if attributes.key?(:'date')
401
+ self.date = attributes[:'date']
402
+ end
403
+
404
+ if attributes.key?(:'amount')
405
+ self.amount = attributes[:'amount']
406
+ end
407
+
408
+ if attributes.key?(:'description')
409
+ self.description = attributes[:'description']
410
+ end
411
+
412
+ if attributes.key?(:'order')
413
+ self.order = attributes[:'order']
414
+ end
415
+
416
+ if attributes.key?(:'currency_id')
417
+ self.currency_id = attributes[:'currency_id']
418
+ end
419
+
420
+ if attributes.key?(:'currency_code')
421
+ self.currency_code = attributes[:'currency_code']
422
+ end
423
+
424
+ if attributes.key?(:'currency_symbol')
425
+ self.currency_symbol = attributes[:'currency_symbol']
426
+ end
427
+
428
+ if attributes.key?(:'currency_name')
429
+ self.currency_name = attributes[:'currency_name']
430
+ end
431
+
432
+ if attributes.key?(:'currency_decimal_places')
433
+ self.currency_decimal_places = attributes[:'currency_decimal_places']
434
+ end
435
+
436
+ if attributes.key?(:'foreign_amount')
437
+ self.foreign_amount = attributes[:'foreign_amount']
438
+ end
439
+
440
+ if attributes.key?(:'foreign_currency_id')
441
+ self.foreign_currency_id = attributes[:'foreign_currency_id']
442
+ end
443
+
444
+ if attributes.key?(:'foreign_currency_code')
445
+ self.foreign_currency_code = attributes[:'foreign_currency_code']
446
+ end
447
+
448
+ if attributes.key?(:'foreign_currency_symbol')
449
+ self.foreign_currency_symbol = attributes[:'foreign_currency_symbol']
450
+ end
451
+
452
+ if attributes.key?(:'foreign_currency_decimal_places')
453
+ self.foreign_currency_decimal_places = attributes[:'foreign_currency_decimal_places']
454
+ end
455
+
456
+ if attributes.key?(:'budget_id')
457
+ self.budget_id = attributes[:'budget_id']
458
+ end
459
+
460
+ if attributes.key?(:'budget_name')
461
+ self.budget_name = attributes[:'budget_name']
462
+ end
463
+
464
+ if attributes.key?(:'category_id')
465
+ self.category_id = attributes[:'category_id']
466
+ end
467
+
468
+ if attributes.key?(:'category_name')
469
+ self.category_name = attributes[:'category_name']
470
+ end
471
+
472
+ if attributes.key?(:'source_id')
473
+ self.source_id = attributes[:'source_id']
474
+ end
475
+
476
+ if attributes.key?(:'source_name')
477
+ self.source_name = attributes[:'source_name']
478
+ end
479
+
480
+ if attributes.key?(:'source_iban')
481
+ self.source_iban = attributes[:'source_iban']
482
+ end
483
+
484
+ if attributes.key?(:'source_type')
485
+ self.source_type = attributes[:'source_type']
486
+ end
487
+
488
+ if attributes.key?(:'destination_id')
489
+ self.destination_id = attributes[:'destination_id']
490
+ end
491
+
492
+ if attributes.key?(:'destination_name')
493
+ self.destination_name = attributes[:'destination_name']
494
+ end
495
+
496
+ if attributes.key?(:'destination_iban')
497
+ self.destination_iban = attributes[:'destination_iban']
498
+ end
499
+
500
+ if attributes.key?(:'destination_type')
501
+ self.destination_type = attributes[:'destination_type']
502
+ end
503
+
504
+ if attributes.key?(:'reconciled')
505
+ self.reconciled = attributes[:'reconciled']
506
+ end
507
+
508
+ if attributes.key?(:'piggy_bank_id')
509
+ self.piggy_bank_id = attributes[:'piggy_bank_id']
510
+ end
511
+
512
+ if attributes.key?(:'piggy_bank_name')
513
+ self.piggy_bank_name = attributes[:'piggy_bank_name']
514
+ end
515
+
516
+ if attributes.key?(:'bill_id')
517
+ self.bill_id = attributes[:'bill_id']
518
+ end
519
+
520
+ if attributes.key?(:'bill_name')
521
+ self.bill_name = attributes[:'bill_name']
522
+ end
523
+
524
+ if attributes.key?(:'tags')
525
+ if (value = attributes[:'tags']).is_a?(Array)
526
+ self.tags = value
527
+ end
528
+ end
529
+
530
+ if attributes.key?(:'notes')
531
+ self.notes = attributes[:'notes']
532
+ end
533
+
534
+ if attributes.key?(:'internal_reference')
535
+ self.internal_reference = attributes[:'internal_reference']
536
+ end
537
+
538
+ if attributes.key?(:'external_id')
539
+ self.external_id = attributes[:'external_id']
540
+ end
541
+
542
+ if attributes.key?(:'original_source')
543
+ self.original_source = attributes[:'original_source']
544
+ end
545
+
546
+ if attributes.key?(:'recurrence_id')
547
+ self.recurrence_id = attributes[:'recurrence_id']
548
+ end
549
+
550
+ if attributes.key?(:'bunq_payment_id')
551
+ self.bunq_payment_id = attributes[:'bunq_payment_id']
552
+ end
553
+
554
+ if attributes.key?(:'import_hash_v2')
555
+ self.import_hash_v2 = attributes[:'import_hash_v2']
556
+ end
557
+
558
+ if attributes.key?(:'sepa_cc')
559
+ self.sepa_cc = attributes[:'sepa_cc']
560
+ end
561
+
562
+ if attributes.key?(:'sepa_ct_op')
563
+ self.sepa_ct_op = attributes[:'sepa_ct_op']
564
+ end
565
+
566
+ if attributes.key?(:'sepa_ct_id')
567
+ self.sepa_ct_id = attributes[:'sepa_ct_id']
568
+ end
569
+
570
+ if attributes.key?(:'sepa_db')
571
+ self.sepa_db = attributes[:'sepa_db']
572
+ end
573
+
574
+ if attributes.key?(:'sepa_country')
575
+ self.sepa_country = attributes[:'sepa_country']
576
+ end
577
+
578
+ if attributes.key?(:'sepa_ep')
579
+ self.sepa_ep = attributes[:'sepa_ep']
580
+ end
581
+
582
+ if attributes.key?(:'sepa_ci')
583
+ self.sepa_ci = attributes[:'sepa_ci']
584
+ end
585
+
586
+ if attributes.key?(:'sepa_batch_id')
587
+ self.sepa_batch_id = attributes[:'sepa_batch_id']
588
+ end
589
+
590
+ if attributes.key?(:'interest_date')
591
+ self.interest_date = attributes[:'interest_date']
592
+ end
593
+
594
+ if attributes.key?(:'book_date')
595
+ self.book_date = attributes[:'book_date']
596
+ end
597
+
598
+ if attributes.key?(:'process_date')
599
+ self.process_date = attributes[:'process_date']
600
+ end
601
+
602
+ if attributes.key?(:'due_date')
603
+ self.due_date = attributes[:'due_date']
604
+ end
605
+
606
+ if attributes.key?(:'payment_date')
607
+ self.payment_date = attributes[:'payment_date']
608
+ end
609
+
610
+ if attributes.key?(:'invoice_date')
611
+ self.invoice_date = attributes[:'invoice_date']
612
+ end
613
+ end
614
+
615
+ # Show invalid properties with the reasons. Usually used together with valid?
616
+ # @return Array for valid properties with the reasons
617
+ def list_invalid_properties
618
+ invalid_properties = Array.new
619
+ if @date.nil?
620
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
621
+ end
622
+
623
+ if @amount.nil?
624
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
625
+ end
626
+
627
+ if @description.nil?
628
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
629
+ end
630
+
631
+ invalid_properties
632
+ end
633
+
634
+ # Check to see if the all the properties in the model are valid
635
+ # @return true if the model is valid
636
+ def valid?
637
+ type_validator = EnumAttributeValidator.new('String', ["withdrawal", "expense", "deposit", "transfer", "opening-balance", "reconciliation"])
638
+ return false unless type_validator.valid?(@type)
639
+ return false if @date.nil?
640
+ return false if @amount.nil?
641
+ return false if @description.nil?
642
+ true
643
+ end
644
+
645
+ # Custom attribute writer method checking allowed values (enum).
646
+ # @param [Object] type Object to be assigned
647
+ def type=(type)
648
+ validator = EnumAttributeValidator.new('String', ["withdrawal", "expense", "deposit", "transfer", "opening-balance", "reconciliation"])
649
+ unless validator.valid?(type)
650
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
651
+ end
652
+ @type = type
653
+ end
654
+
655
+ # Checks equality by comparing each attribute.
656
+ # @param [Object] Object to be compared
657
+ def ==(o)
658
+ return true if self.equal?(o)
659
+ self.class == o.class &&
660
+ user == o.user &&
661
+ transaction_journal_id == o.transaction_journal_id &&
662
+ type == o.type &&
663
+ date == o.date &&
664
+ amount == o.amount &&
665
+ description == o.description &&
666
+ order == o.order &&
667
+ currency_id == o.currency_id &&
668
+ currency_code == o.currency_code &&
669
+ currency_symbol == o.currency_symbol &&
670
+ currency_name == o.currency_name &&
671
+ currency_decimal_places == o.currency_decimal_places &&
672
+ foreign_amount == o.foreign_amount &&
673
+ foreign_currency_id == o.foreign_currency_id &&
674
+ foreign_currency_code == o.foreign_currency_code &&
675
+ foreign_currency_symbol == o.foreign_currency_symbol &&
676
+ foreign_currency_decimal_places == o.foreign_currency_decimal_places &&
677
+ budget_id == o.budget_id &&
678
+ budget_name == o.budget_name &&
679
+ category_id == o.category_id &&
680
+ category_name == o.category_name &&
681
+ source_id == o.source_id &&
682
+ source_name == o.source_name &&
683
+ source_iban == o.source_iban &&
684
+ source_type == o.source_type &&
685
+ destination_id == o.destination_id &&
686
+ destination_name == o.destination_name &&
687
+ destination_iban == o.destination_iban &&
688
+ destination_type == o.destination_type &&
689
+ reconciled == o.reconciled &&
690
+ piggy_bank_id == o.piggy_bank_id &&
691
+ piggy_bank_name == o.piggy_bank_name &&
692
+ bill_id == o.bill_id &&
693
+ bill_name == o.bill_name &&
694
+ tags == o.tags &&
695
+ notes == o.notes &&
696
+ internal_reference == o.internal_reference &&
697
+ external_id == o.external_id &&
698
+ original_source == o.original_source &&
699
+ recurrence_id == o.recurrence_id &&
700
+ bunq_payment_id == o.bunq_payment_id &&
701
+ import_hash_v2 == o.import_hash_v2 &&
702
+ sepa_cc == o.sepa_cc &&
703
+ sepa_ct_op == o.sepa_ct_op &&
704
+ sepa_ct_id == o.sepa_ct_id &&
705
+ sepa_db == o.sepa_db &&
706
+ sepa_country == o.sepa_country &&
707
+ sepa_ep == o.sepa_ep &&
708
+ sepa_ci == o.sepa_ci &&
709
+ sepa_batch_id == o.sepa_batch_id &&
710
+ interest_date == o.interest_date &&
711
+ book_date == o.book_date &&
712
+ process_date == o.process_date &&
713
+ due_date == o.due_date &&
714
+ payment_date == o.payment_date &&
715
+ invoice_date == o.invoice_date
716
+ end
717
+
718
+ # @see the `==` method
719
+ # @param [Object] Object to be compared
720
+ def eql?(o)
721
+ self == o
722
+ end
723
+
724
+ # Calculates hash code according to all attributes.
725
+ # @return [Integer] Hash code
726
+ def hash
727
+ [user, transaction_journal_id, type, date, amount, description, order, currency_id, currency_code, currency_symbol, currency_name, currency_decimal_places, foreign_amount, foreign_currency_id, foreign_currency_code, foreign_currency_symbol, foreign_currency_decimal_places, budget_id, budget_name, category_id, category_name, source_id, source_name, source_iban, source_type, destination_id, destination_name, destination_iban, destination_type, reconciled, piggy_bank_id, piggy_bank_name, bill_id, bill_name, tags, notes, internal_reference, external_id, original_source, recurrence_id, bunq_payment_id, import_hash_v2, sepa_cc, sepa_ct_op, sepa_ct_id, sepa_db, sepa_country, sepa_ep, sepa_ci, sepa_batch_id, interest_date, book_date, process_date, due_date, payment_date, invoice_date].hash
728
+ end
729
+
730
+ # Builds the object from hash
731
+ # @param [Hash] attributes Model attributes in the form of hash
732
+ # @return [Object] Returns the model itself
733
+ def self.build_from_hash(attributes)
734
+ new.build_from_hash(attributes)
735
+ end
736
+
737
+ # Builds the object from hash
738
+ # @param [Hash] attributes Model attributes in the form of hash
739
+ # @return [Object] Returns the model itself
740
+ def build_from_hash(attributes)
741
+ return nil unless attributes.is_a?(Hash)
742
+ self.class.openapi_types.each_pair do |key, type|
743
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
744
+ self.send("#{key}=", nil)
745
+ elsif type =~ /\AArray<(.*)>/i
746
+ # check to ensure the input is an array given that the attribute
747
+ # is documented as an array but the input is not
748
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
749
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
750
+ end
751
+ elsif !attributes[self.class.attribute_map[key]].nil?
752
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
753
+ end
754
+ end
755
+
756
+ self
757
+ end
758
+
759
+ # Deserializes the data based on type
760
+ # @param string type Data type
761
+ # @param string value Value to be deserialized
762
+ # @return [Object] Deserialized data
763
+ def _deserialize(type, value)
764
+ case type.to_sym
765
+ when :Time
766
+ Time.parse(value)
767
+ when :Date
768
+ Date.parse(value)
769
+ when :String
770
+ value.to_s
771
+ when :Integer
772
+ value.to_i
773
+ when :Float
774
+ value.to_f
775
+ when :Boolean
776
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
777
+ true
778
+ else
779
+ false
780
+ end
781
+ when :Object
782
+ # generic object (usually a Hash), return directly
783
+ value
784
+ when /\AArray<(?<inner_type>.+)>\z/
785
+ inner_type = Regexp.last_match[:inner_type]
786
+ value.map { |v| _deserialize(inner_type, v) }
787
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
788
+ k_type = Regexp.last_match[:k_type]
789
+ v_type = Regexp.last_match[:v_type]
790
+ {}.tap do |hash|
791
+ value.each do |k, v|
792
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
793
+ end
794
+ end
795
+ else # model
796
+ # models (e.g. Pet) or oneOf
797
+ klass = FireflyIIIClient.const_get(type)
798
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
799
+ end
800
+ end
801
+
802
+ # Returns the string representation of the object
803
+ # @return [String] String presentation of the object
804
+ def to_s
805
+ to_hash.to_s
806
+ end
807
+
808
+ # to_body is an alias to to_hash (backward compatibility)
809
+ # @return [Hash] Returns the object in the form of hash
810
+ def to_body
811
+ to_hash
812
+ end
813
+
814
+ # Returns the object in the form of hash
815
+ # @return [Hash] Returns the object in the form of hash
816
+ def to_hash
817
+ hash = {}
818
+ self.class.attribute_map.each_pair do |attr, param|
819
+ value = self.send(attr)
820
+ if value.nil?
821
+ is_nullable = self.class.openapi_nullable.include?(attr)
822
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
823
+ end
824
+
825
+ hash[param] = _to_hash(value)
826
+ end
827
+ hash
828
+ end
829
+
830
+ # Outputs non-array value in the form of hash
831
+ # For object, use to_hash. Otherwise, just return the value
832
+ # @param [Object] value Any valid value
833
+ # @return [Hash] Returns the value in the form of hash
834
+ def _to_hash(value)
835
+ if value.is_a?(Array)
836
+ value.compact.map { |v| _to_hash(v) }
837
+ elsif value.is_a?(Hash)
838
+ {}.tap do |hash|
839
+ value.each { |k, v| hash[k] = _to_hash(v) }
840
+ end
841
+ elsif value.respond_to? :to_hash
842
+ value.to_hash
843
+ else
844
+ value
845
+ end
846
+ end
847
+
848
+ end
849
+
850
+ end