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,57 @@
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
+ module FireflyIIIClient
14
+ class ApiError < StandardError
15
+ attr_reader :code, :response_headers, :response_body
16
+
17
+ # Usage examples:
18
+ # ApiError.new
19
+ # ApiError.new("message")
20
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
21
+ # ApiError.new(:code => 404, :message => "Not Found")
22
+ def initialize(arg = nil)
23
+ if arg.is_a? Hash
24
+ if arg.key?(:message) || arg.key?('message')
25
+ super(arg[:message] || arg['message'])
26
+ else
27
+ super arg
28
+ end
29
+
30
+ arg.each do |k, v|
31
+ instance_variable_set "@#{k}", v
32
+ end
33
+ else
34
+ super arg
35
+ end
36
+ end
37
+
38
+ # Override to_s to display a friendly error message
39
+ def to_s
40
+ message
41
+ end
42
+
43
+ def message
44
+ if @message.nil?
45
+ msg = "Error message: the server returns an error"
46
+ else
47
+ msg = @message
48
+ end
49
+
50
+ msg += "\nHTTP status code: #{code}" if code
51
+ msg += "\nResponse headers: #{response_headers}" if response_headers
52
+ msg += "\nResponse body: #{response_body}" if response_body
53
+
54
+ msg
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,277 @@
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
+ module FireflyIIIClient
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
66
+ # details will be logged with `logger.debug` (see the `logger` attribute).
67
+ # Default to false.
68
+ #
69
+ # @return [true, false]
70
+ attr_accessor :debugging
71
+
72
+ # Defines the logger used for debugging.
73
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
74
+ #
75
+ # @return [#debug]
76
+ attr_accessor :logger
77
+
78
+ # Defines the temporary folder to store downloaded files
79
+ # (for API endpoints that have file response).
80
+ # Default to use `Tempfile`.
81
+ #
82
+ # @return [String]
83
+ attr_accessor :temp_folder_path
84
+
85
+ # The time limit for HTTP request in seconds.
86
+ # Default to 0 (never times out).
87
+ attr_accessor :timeout
88
+
89
+ # Set this to false to skip client side validation in the operation.
90
+ # Default to true.
91
+ # @return [true, false]
92
+ attr_accessor :client_side_validation
93
+
94
+ ### TLS/SSL setting
95
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
96
+ # Default to true.
97
+ #
98
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
99
+ #
100
+ # @return [true, false]
101
+ attr_accessor :verify_ssl
102
+
103
+ ### TLS/SSL setting
104
+ # Set this to false to skip verifying SSL host name
105
+ # Default to true.
106
+ #
107
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
108
+ #
109
+ # @return [true, false]
110
+ attr_accessor :verify_ssl_host
111
+
112
+ ### TLS/SSL setting
113
+ # Set this to customize the certificate file to verify the peer.
114
+ #
115
+ # @return [String] the path to the certificate file
116
+ #
117
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
118
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
119
+ attr_accessor :ssl_ca_cert
120
+
121
+ ### TLS/SSL setting
122
+ # Client certificate file (for client certificate)
123
+ attr_accessor :cert_file
124
+
125
+ ### TLS/SSL setting
126
+ # Client private key file (for client certificate)
127
+ attr_accessor :key_file
128
+
129
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
130
+ # Default to nil.
131
+ #
132
+ # @see The params_encoding option of Ethon. Related source code:
133
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
134
+ attr_accessor :params_encoding
135
+
136
+ attr_accessor :inject_format
137
+
138
+ attr_accessor :force_ending_format
139
+
140
+ def initialize
141
+ @scheme = 'https'
142
+ @host = 'demo.firefly-iii.org'
143
+ @base_path = ''
144
+ @server_index = 0
145
+ @server_operation_index = {}
146
+ @server_variables = {}
147
+ @server_operation_variables = {}
148
+ @api_key = {}
149
+ @api_key_prefix = {}
150
+ @timeout = 0
151
+ @client_side_validation = true
152
+ @verify_ssl = true
153
+ @verify_ssl_host = true
154
+ @params_encoding = nil
155
+ @cert_file = nil
156
+ @key_file = nil
157
+ @debugging = false
158
+ @inject_format = false
159
+ @force_ending_format = false
160
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
161
+
162
+ yield(self) if block_given?
163
+ end
164
+
165
+ # The default Configuration object.
166
+ def self.default
167
+ @@default ||= Configuration.new
168
+ end
169
+
170
+ def configure
171
+ yield(self) if block_given?
172
+ end
173
+
174
+ def scheme=(scheme)
175
+ # remove :// from scheme
176
+ @scheme = scheme.sub(/:\/\//, '')
177
+ end
178
+
179
+ def host=(host)
180
+ # remove http(s):// and anything after a slash
181
+ @host = host.sub(/https?:\/\//, '').split('/').first
182
+ end
183
+
184
+ def base_path=(base_path)
185
+ # Add leading and trailing slashes to base_path
186
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
187
+ @base_path = '' if @base_path == '/'
188
+ end
189
+
190
+ # Returns base URL for specified operation based on server settings
191
+ def base_url(operation = nil)
192
+ index = server_operation_index.fetch(operation, server_index)
193
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
194
+
195
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
196
+ end
197
+
198
+ # Gets API key (with prefix if set).
199
+ # @param [String] param_name the parameter name of API key auth
200
+ def api_key_with_prefix(param_name, param_alias = nil)
201
+ key = @api_key[param_name]
202
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
203
+ if @api_key_prefix[param_name]
204
+ "#{@api_key_prefix[param_name]} #{key}"
205
+ else
206
+ key
207
+ end
208
+ end
209
+
210
+ # Gets Basic Auth token string
211
+ def basic_auth_token
212
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
213
+ end
214
+
215
+ # Returns Auth Settings hash for api client.
216
+ def auth_settings
217
+ {
218
+ 'firefly_iii_auth' =>
219
+ {
220
+ type: 'oauth2',
221
+ in: 'header',
222
+ key: 'Authorization',
223
+ value: "Bearer #{access_token}"
224
+ },
225
+ }
226
+ end
227
+
228
+ # Returns an array of Server setting
229
+ def server_settings
230
+ [
231
+ {
232
+ url: "https://demo.firefly-iii.org",
233
+ description: "Firefly III demo site",
234
+ }
235
+ ]
236
+ end
237
+
238
+ def operation_server_settings
239
+ {
240
+ }
241
+ end
242
+
243
+ # Returns URL based on server settings
244
+ #
245
+ # @param index array index of the server settings
246
+ # @param variables hash of variable and the corresponding value
247
+ def server_url(index, variables = {}, servers = nil)
248
+ servers = server_settings if servers == nil
249
+
250
+ # check array index out of bound
251
+ if (index < 0 || index >= servers.size)
252
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
253
+ end
254
+
255
+ server = servers[index]
256
+ url = server[:url]
257
+
258
+ return url unless server.key? :variables
259
+
260
+ # go through variable and assign a value
261
+ server[:variables].each do |name, variable|
262
+ if variables.key?(name)
263
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
264
+ url.gsub! "{" + name.to_s + "}", variables[name]
265
+ else
266
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
267
+ end
268
+ else
269
+ # use default value
270
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
271
+ end
272
+ end
273
+
274
+ url
275
+ end
276
+ end
277
+ end
@@ -0,0 +1,564 @@
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 Account
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :updated_at
21
+
22
+ attr_accessor :name
23
+
24
+ # Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually.
25
+ attr_accessor :type
26
+
27
+ attr_accessor :iban
28
+
29
+ attr_accessor :bic
30
+
31
+ attr_accessor :account_number
32
+
33
+ attr_accessor :opening_balance
34
+
35
+ attr_accessor :opening_balance_date
36
+
37
+ attr_accessor :virtual_balance
38
+
39
+ attr_accessor :current_balance
40
+
41
+ attr_accessor :current_balance_date
42
+
43
+ # Use either currency_id or currency_code. Defaults to the user's default currency.
44
+ attr_accessor :currency_id
45
+
46
+ # Use either currency_id or currency_code. Defaults to the user's default currency.
47
+ attr_accessor :currency_code
48
+
49
+ attr_accessor :currency_symbol
50
+
51
+ attr_accessor :currency_decimal_places
52
+
53
+ # If omitted, defaults to true.
54
+ attr_accessor :active
55
+
56
+ # If omitted, defaults to true.
57
+ attr_accessor :include_net_worth
58
+
59
+ # Is only mandatory when the type is asset.
60
+ attr_accessor :account_role
61
+
62
+ # Mandatory when the account_role is ccAsset. Can only be monthlyFull.
63
+ attr_accessor :credit_card_type
64
+
65
+ # Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank.
66
+ attr_accessor :monthly_payment_date
67
+
68
+ # Mandatory when type is liability. Specifies the exact type.
69
+ attr_accessor :liability_type
70
+
71
+ # Mandatory when type is liability. Amount of money in the liability. Must be positive.
72
+ attr_accessor :liability_amount
73
+
74
+ # Mandatory when type is liability. Start date for the liability.
75
+ attr_accessor :liability_start_date
76
+
77
+ # Mandatory when type is liability. Interest percentage.
78
+ attr_accessor :interest
79
+
80
+ # Mandatory when type is liability. Period over which the interest is calculated.
81
+ attr_accessor :interest_period
82
+
83
+ attr_accessor :notes
84
+
85
+ class EnumAttributeValidator
86
+ attr_reader :datatype
87
+ attr_reader :allowable_values
88
+
89
+ def initialize(datatype, allowable_values)
90
+ @allowable_values = allowable_values.map do |value|
91
+ case datatype.to_s
92
+ when /Integer/i
93
+ value.to_i
94
+ when /Float/i
95
+ value.to_f
96
+ else
97
+ value
98
+ end
99
+ end
100
+ end
101
+
102
+ def valid?(value)
103
+ !value || allowable_values.include?(value)
104
+ end
105
+ end
106
+
107
+ # Attribute mapping from ruby-style variable name to JSON key.
108
+ def self.attribute_map
109
+ {
110
+ :'created_at' => :'created_at',
111
+ :'updated_at' => :'updated_at',
112
+ :'name' => :'name',
113
+ :'type' => :'type',
114
+ :'iban' => :'iban',
115
+ :'bic' => :'bic',
116
+ :'account_number' => :'account_number',
117
+ :'opening_balance' => :'opening_balance',
118
+ :'opening_balance_date' => :'opening_balance_date',
119
+ :'virtual_balance' => :'virtual_balance',
120
+ :'current_balance' => :'current_balance',
121
+ :'current_balance_date' => :'current_balance_date',
122
+ :'currency_id' => :'currency_id',
123
+ :'currency_code' => :'currency_code',
124
+ :'currency_symbol' => :'currency_symbol',
125
+ :'currency_decimal_places' => :'currency_decimal_places',
126
+ :'active' => :'active',
127
+ :'include_net_worth' => :'include_net_worth',
128
+ :'account_role' => :'account_role',
129
+ :'credit_card_type' => :'credit_card_type',
130
+ :'monthly_payment_date' => :'monthly_payment_date',
131
+ :'liability_type' => :'liability_type',
132
+ :'liability_amount' => :'liability_amount',
133
+ :'liability_start_date' => :'liability_start_date',
134
+ :'interest' => :'interest',
135
+ :'interest_period' => :'interest_period',
136
+ :'notes' => :'notes'
137
+ }
138
+ end
139
+
140
+ # Returns all the JSON keys this model knows about
141
+ def self.acceptable_attributes
142
+ attribute_map.values
143
+ end
144
+
145
+ # Attribute type mapping.
146
+ def self.openapi_types
147
+ {
148
+ :'created_at' => :'Time',
149
+ :'updated_at' => :'Time',
150
+ :'name' => :'String',
151
+ :'type' => :'String',
152
+ :'iban' => :'String',
153
+ :'bic' => :'String',
154
+ :'account_number' => :'String',
155
+ :'opening_balance' => :'Float',
156
+ :'opening_balance_date' => :'Date',
157
+ :'virtual_balance' => :'Float',
158
+ :'current_balance' => :'Float',
159
+ :'current_balance_date' => :'Date',
160
+ :'currency_id' => :'Integer',
161
+ :'currency_code' => :'String',
162
+ :'currency_symbol' => :'String',
163
+ :'currency_decimal_places' => :'Integer',
164
+ :'active' => :'Boolean',
165
+ :'include_net_worth' => :'Boolean',
166
+ :'account_role' => :'String',
167
+ :'credit_card_type' => :'String',
168
+ :'monthly_payment_date' => :'Date',
169
+ :'liability_type' => :'String',
170
+ :'liability_amount' => :'Float',
171
+ :'liability_start_date' => :'Date',
172
+ :'interest' => :'Float',
173
+ :'interest_period' => :'String',
174
+ :'notes' => :'String'
175
+ }
176
+ end
177
+
178
+ # List of attributes with nullable: true
179
+ def self.openapi_nullable
180
+ Set.new([
181
+ :'credit_card_type',
182
+ :'monthly_payment_date',
183
+ ])
184
+ end
185
+
186
+ # Initializes the object
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ def initialize(attributes = {})
189
+ if (!attributes.is_a?(Hash))
190
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Account` initialize method"
191
+ end
192
+
193
+ # check to see if the attribute exists and convert string to symbol for hash key
194
+ attributes = attributes.each_with_object({}) { |(k, v), h|
195
+ if (!self.class.attribute_map.key?(k.to_sym))
196
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
197
+ end
198
+ h[k.to_sym] = v
199
+ }
200
+
201
+ if attributes.key?(:'created_at')
202
+ self.created_at = attributes[:'created_at']
203
+ end
204
+
205
+ if attributes.key?(:'updated_at')
206
+ self.updated_at = attributes[:'updated_at']
207
+ end
208
+
209
+ if attributes.key?(:'name')
210
+ self.name = attributes[:'name']
211
+ end
212
+
213
+ if attributes.key?(:'type')
214
+ self.type = attributes[:'type']
215
+ end
216
+
217
+ if attributes.key?(:'iban')
218
+ self.iban = attributes[:'iban']
219
+ end
220
+
221
+ if attributes.key?(:'bic')
222
+ self.bic = attributes[:'bic']
223
+ end
224
+
225
+ if attributes.key?(:'account_number')
226
+ self.account_number = attributes[:'account_number']
227
+ end
228
+
229
+ if attributes.key?(:'opening_balance')
230
+ self.opening_balance = attributes[:'opening_balance']
231
+ end
232
+
233
+ if attributes.key?(:'opening_balance_date')
234
+ self.opening_balance_date = attributes[:'opening_balance_date']
235
+ end
236
+
237
+ if attributes.key?(:'virtual_balance')
238
+ self.virtual_balance = attributes[:'virtual_balance']
239
+ end
240
+
241
+ if attributes.key?(:'current_balance')
242
+ self.current_balance = attributes[:'current_balance']
243
+ end
244
+
245
+ if attributes.key?(:'current_balance_date')
246
+ self.current_balance_date = attributes[:'current_balance_date']
247
+ end
248
+
249
+ if attributes.key?(:'currency_id')
250
+ self.currency_id = attributes[:'currency_id']
251
+ end
252
+
253
+ if attributes.key?(:'currency_code')
254
+ self.currency_code = attributes[:'currency_code']
255
+ end
256
+
257
+ if attributes.key?(:'currency_symbol')
258
+ self.currency_symbol = attributes[:'currency_symbol']
259
+ end
260
+
261
+ if attributes.key?(:'currency_decimal_places')
262
+ self.currency_decimal_places = attributes[:'currency_decimal_places']
263
+ end
264
+
265
+ if attributes.key?(:'active')
266
+ self.active = attributes[:'active']
267
+ end
268
+
269
+ if attributes.key?(:'include_net_worth')
270
+ self.include_net_worth = attributes[:'include_net_worth']
271
+ end
272
+
273
+ if attributes.key?(:'account_role')
274
+ self.account_role = attributes[:'account_role']
275
+ end
276
+
277
+ if attributes.key?(:'credit_card_type')
278
+ self.credit_card_type = attributes[:'credit_card_type']
279
+ end
280
+
281
+ if attributes.key?(:'monthly_payment_date')
282
+ self.monthly_payment_date = attributes[:'monthly_payment_date']
283
+ end
284
+
285
+ if attributes.key?(:'liability_type')
286
+ self.liability_type = attributes[:'liability_type']
287
+ end
288
+
289
+ if attributes.key?(:'liability_amount')
290
+ self.liability_amount = attributes[:'liability_amount']
291
+ end
292
+
293
+ if attributes.key?(:'liability_start_date')
294
+ self.liability_start_date = attributes[:'liability_start_date']
295
+ end
296
+
297
+ if attributes.key?(:'interest')
298
+ self.interest = attributes[:'interest']
299
+ end
300
+
301
+ if attributes.key?(:'interest_period')
302
+ self.interest_period = attributes[:'interest_period']
303
+ end
304
+
305
+ if attributes.key?(:'notes')
306
+ self.notes = attributes[:'notes']
307
+ end
308
+ end
309
+
310
+ # Show invalid properties with the reasons. Usually used together with valid?
311
+ # @return Array for valid properties with the reasons
312
+ def list_invalid_properties
313
+ invalid_properties = Array.new
314
+ if @name.nil?
315
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
316
+ end
317
+
318
+ if @type.nil?
319
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
320
+ end
321
+
322
+ if @account_role.nil?
323
+ invalid_properties.push('invalid value for "account_role", account_role cannot be nil.')
324
+ end
325
+
326
+ invalid_properties
327
+ end
328
+
329
+ # Check to see if the all the properties in the model are valid
330
+ # @return true if the model is valid
331
+ def valid?
332
+ return false if @name.nil?
333
+ return false if @type.nil?
334
+ type_validator = EnumAttributeValidator.new('String', ["asset", "expense", "import", "revenue", "cash", "liability", "liabilities", "initial-balance", "reconciliation"])
335
+ return false unless type_validator.valid?(@type)
336
+ return false if @account_role.nil?
337
+ account_role_validator = EnumAttributeValidator.new('String', ["defaultAsset", "sharedAsset", "savingAsset", "ccAsset", "cashWalletAsset"])
338
+ return false unless account_role_validator.valid?(@account_role)
339
+ credit_card_type_validator = EnumAttributeValidator.new('String', ["monthlyFull"])
340
+ return false unless credit_card_type_validator.valid?(@credit_card_type)
341
+ liability_type_validator = EnumAttributeValidator.new('String', ["loan", "debt", "mortgage"])
342
+ return false unless liability_type_validator.valid?(@liability_type)
343
+ interest_period_validator = EnumAttributeValidator.new('String', ["daily", "monthly", "yearly"])
344
+ return false unless interest_period_validator.valid?(@interest_period)
345
+ true
346
+ end
347
+
348
+ # Custom attribute writer method checking allowed values (enum).
349
+ # @param [Object] type Object to be assigned
350
+ def type=(type)
351
+ validator = EnumAttributeValidator.new('String', ["asset", "expense", "import", "revenue", "cash", "liability", "liabilities", "initial-balance", "reconciliation"])
352
+ unless validator.valid?(type)
353
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
354
+ end
355
+ @type = type
356
+ end
357
+
358
+ # Custom attribute writer method checking allowed values (enum).
359
+ # @param [Object] account_role Object to be assigned
360
+ def account_role=(account_role)
361
+ validator = EnumAttributeValidator.new('String', ["defaultAsset", "sharedAsset", "savingAsset", "ccAsset", "cashWalletAsset"])
362
+ unless validator.valid?(account_role)
363
+ fail ArgumentError, "invalid value for \"account_role\", must be one of #{validator.allowable_values}."
364
+ end
365
+ @account_role = account_role
366
+ end
367
+
368
+ # Custom attribute writer method checking allowed values (enum).
369
+ # @param [Object] credit_card_type Object to be assigned
370
+ def credit_card_type=(credit_card_type)
371
+ validator = EnumAttributeValidator.new('String', ["monthlyFull"])
372
+ unless validator.valid?(credit_card_type)
373
+ fail ArgumentError, "invalid value for \"credit_card_type\", must be one of #{validator.allowable_values}."
374
+ end
375
+ @credit_card_type = credit_card_type
376
+ end
377
+
378
+ # Custom attribute writer method checking allowed values (enum).
379
+ # @param [Object] liability_type Object to be assigned
380
+ def liability_type=(liability_type)
381
+ validator = EnumAttributeValidator.new('String', ["loan", "debt", "mortgage"])
382
+ unless validator.valid?(liability_type)
383
+ fail ArgumentError, "invalid value for \"liability_type\", must be one of #{validator.allowable_values}."
384
+ end
385
+ @liability_type = liability_type
386
+ end
387
+
388
+ # Custom attribute writer method checking allowed values (enum).
389
+ # @param [Object] interest_period Object to be assigned
390
+ def interest_period=(interest_period)
391
+ validator = EnumAttributeValidator.new('String', ["daily", "monthly", "yearly"])
392
+ unless validator.valid?(interest_period)
393
+ fail ArgumentError, "invalid value for \"interest_period\", must be one of #{validator.allowable_values}."
394
+ end
395
+ @interest_period = interest_period
396
+ end
397
+
398
+ # Checks equality by comparing each attribute.
399
+ # @param [Object] Object to be compared
400
+ def ==(o)
401
+ return true if self.equal?(o)
402
+ self.class == o.class &&
403
+ created_at == o.created_at &&
404
+ updated_at == o.updated_at &&
405
+ name == o.name &&
406
+ type == o.type &&
407
+ iban == o.iban &&
408
+ bic == o.bic &&
409
+ account_number == o.account_number &&
410
+ opening_balance == o.opening_balance &&
411
+ opening_balance_date == o.opening_balance_date &&
412
+ virtual_balance == o.virtual_balance &&
413
+ current_balance == o.current_balance &&
414
+ current_balance_date == o.current_balance_date &&
415
+ currency_id == o.currency_id &&
416
+ currency_code == o.currency_code &&
417
+ currency_symbol == o.currency_symbol &&
418
+ currency_decimal_places == o.currency_decimal_places &&
419
+ active == o.active &&
420
+ include_net_worth == o.include_net_worth &&
421
+ account_role == o.account_role &&
422
+ credit_card_type == o.credit_card_type &&
423
+ monthly_payment_date == o.monthly_payment_date &&
424
+ liability_type == o.liability_type &&
425
+ liability_amount == o.liability_amount &&
426
+ liability_start_date == o.liability_start_date &&
427
+ interest == o.interest &&
428
+ interest_period == o.interest_period &&
429
+ notes == o.notes
430
+ end
431
+
432
+ # @see the `==` method
433
+ # @param [Object] Object to be compared
434
+ def eql?(o)
435
+ self == o
436
+ end
437
+
438
+ # Calculates hash code according to all attributes.
439
+ # @return [Integer] Hash code
440
+ def hash
441
+ [created_at, updated_at, name, type, iban, bic, account_number, opening_balance, opening_balance_date, virtual_balance, current_balance, current_balance_date, currency_id, currency_code, currency_symbol, currency_decimal_places, active, include_net_worth, account_role, credit_card_type, monthly_payment_date, liability_type, liability_amount, liability_start_date, interest, interest_period, notes].hash
442
+ end
443
+
444
+ # Builds the object from hash
445
+ # @param [Hash] attributes Model attributes in the form of hash
446
+ # @return [Object] Returns the model itself
447
+ def self.build_from_hash(attributes)
448
+ new.build_from_hash(attributes)
449
+ end
450
+
451
+ # Builds the object from hash
452
+ # @param [Hash] attributes Model attributes in the form of hash
453
+ # @return [Object] Returns the model itself
454
+ def build_from_hash(attributes)
455
+ return nil unless attributes.is_a?(Hash)
456
+ self.class.openapi_types.each_pair do |key, type|
457
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
458
+ self.send("#{key}=", nil)
459
+ elsif type =~ /\AArray<(.*)>/i
460
+ # check to ensure the input is an array given that the attribute
461
+ # is documented as an array but the input is not
462
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
463
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
464
+ end
465
+ elsif !attributes[self.class.attribute_map[key]].nil?
466
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
467
+ end
468
+ end
469
+
470
+ self
471
+ end
472
+
473
+ # Deserializes the data based on type
474
+ # @param string type Data type
475
+ # @param string value Value to be deserialized
476
+ # @return [Object] Deserialized data
477
+ def _deserialize(type, value)
478
+ case type.to_sym
479
+ when :Time
480
+ Time.parse(value)
481
+ when :Date
482
+ Date.parse(value)
483
+ when :String
484
+ value.to_s
485
+ when :Integer
486
+ value.to_i
487
+ when :Float
488
+ value.to_f
489
+ when :Boolean
490
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
491
+ true
492
+ else
493
+ false
494
+ end
495
+ when :Object
496
+ # generic object (usually a Hash), return directly
497
+ value
498
+ when /\AArray<(?<inner_type>.+)>\z/
499
+ inner_type = Regexp.last_match[:inner_type]
500
+ value.map { |v| _deserialize(inner_type, v) }
501
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
502
+ k_type = Regexp.last_match[:k_type]
503
+ v_type = Regexp.last_match[:v_type]
504
+ {}.tap do |hash|
505
+ value.each do |k, v|
506
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
507
+ end
508
+ end
509
+ else # model
510
+ # models (e.g. Pet) or oneOf
511
+ klass = FireflyIIIClient.const_get(type)
512
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
513
+ end
514
+ end
515
+
516
+ # Returns the string representation of the object
517
+ # @return [String] String presentation of the object
518
+ def to_s
519
+ to_hash.to_s
520
+ end
521
+
522
+ # to_body is an alias to to_hash (backward compatibility)
523
+ # @return [Hash] Returns the object in the form of hash
524
+ def to_body
525
+ to_hash
526
+ end
527
+
528
+ # Returns the object in the form of hash
529
+ # @return [Hash] Returns the object in the form of hash
530
+ def to_hash
531
+ hash = {}
532
+ self.class.attribute_map.each_pair do |attr, param|
533
+ value = self.send(attr)
534
+ if value.nil?
535
+ is_nullable = self.class.openapi_nullable.include?(attr)
536
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
537
+ end
538
+
539
+ hash[param] = _to_hash(value)
540
+ end
541
+ hash
542
+ end
543
+
544
+ # Outputs non-array value in the form of hash
545
+ # For object, use to_hash. Otherwise, just return the value
546
+ # @param [Object] value Any valid value
547
+ # @return [Hash] Returns the value in the form of hash
548
+ def _to_hash(value)
549
+ if value.is_a?(Array)
550
+ value.compact.map { |v| _to_hash(v) }
551
+ elsif value.is_a?(Hash)
552
+ {}.tap do |hash|
553
+ value.each { |k, v| hash[k] = _to_hash(v) }
554
+ end
555
+ elsif value.respond_to? :to_hash
556
+ value.to_hash
557
+ else
558
+ value
559
+ end
560
+ end
561
+
562
+ end
563
+
564
+ end